tests/testthat/test-regex-time.R

test_that("regex_time function works correctly", {
  # Test the function with the "hh:mm" format
  regex <- regex_time("hh:mm")
  expect_match("09:05", regex)
  expect_no_match("9:5", regex)

  # Test the function with the "h:m" format
  regex <- regex_time("h:m")
  expect_match("9:5", regex)
  expect_no_match("09:05", regex)

  # Add more tests here for other formats
})

Try the vvauditor package in your browser

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

vvauditor documentation built on May 29, 2024, 12:20 p.m.