tests/testthat/test-randString.R

test_that("Generate one random string", {
  expect_equal(length(randString(1,5)),1)
})

test_that("Generate one random string with 5 characters", {
  expect_equal(length(randString(5,5)),5)
})


test_that("Generate five random string", {
  expect_equal(nchar(randString(1,5)),5)
})


test_that("Generate five random string and 10 characters each", {
  expect_equal(nchar(randString(5,10)),rep(10,5))
})

Try the quickcode package in your browser

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

quickcode documentation built on April 11, 2025, 5:49 p.m.