tests/testthat/test_main.R

library(VEH0122)
context("main")
test_that("sheetIsAYear doesn't give an error for non-numbers", {
    expect_equal(FALSE, sheetIsAYear("234L"))
    expect_equal(FALSE, sheetIsAYear("L65L"))                 
    expect_equal(FALSE, sheetIsAYear("LsdfsdL"))
    expect_equal(FALSE, sheetIsAYear("LSdf"))
})

test_that("sheetIsAYear returns true for four letter numbers", {
    expect_equal(TRUE, sheetIsAYear(2345))
    expect_equal(TRUE, sheetIsAYear("4356"))                 
    expect_equal(FALSE, sheetIsAYear(12345))
    expect_equal(FALSE, sheetIsAYear("12345"))
})
mihamn/VEH0122 documentation built on July 11, 2020, 3:45 a.m.