tests/testthat/test-random_time_string.R

context("Random time string helper")

test_that("Generating random strings", {
  random_strings <- sapply(seq_len(1000), function(x) random_time_string())
  expect_equal(length(unique(random_strings)), length(random_strings))

  random_strings <- sapply(seq_len(1000), function(x) random_time_string("somestring"))
  expect_equal(length(unique(random_strings)), length(random_strings))
})

Try the dynutils package in your browser

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

dynutils documentation built on Oct. 11, 2022, 5:07 p.m.