tests/testthat/test_qrcode_gen.R

test_that("qrcode_gen() has a stable output", {
  expect_snapshot_value(
    qrcode_gen("www.r-project.org", dataOutput = TRUE, plotQRcode = FALSE),
    cran = TRUE, style = "json2"
  )
  expect_snapshot_value(
    qrcode_gen(
      "www.r-project.org", dataOutput = TRUE, plotQRcode = FALSE,
      ErrorCorrectionLevel = "M"
    ),
    cran = TRUE, style = "json2"
  )
  expect_snapshot_value(
    qrcode_gen(
      "www.r-project.org", dataOutput = TRUE, plotQRcode = FALSE,
      ErrorCorrectionLevel = "H"
    ),
    cran = TRUE, style = "json2"
  )
  expect_snapshot_value(
    qrcode_gen(
      "www.r-project.org", dataOutput = TRUE, plotQRcode = FALSE,
      ErrorCorrectionLevel = "Q"
    ),
    cran = TRUE, style = "json2"
  )
})

Try the qrcode package in your browser

Any scripts or data that you put into this service are public.

qrcode documentation built on July 2, 2021, 5:06 p.m.