tests/testthat/test-strsplit.R

test_that('Strsplit test!', {
  x <- c("3D/MON&SUN2D/MON&SUN")
  expect_error(strsplit(strsplit(x, "S", type = "WILLBEERROR")))
  expect_equal(strsplit(x, "/", type = "remove"), list(c("3D","MON&SUN2D","MON&SUN")))
  expect_equal(strsplit(x,""),list(c("3", "D", "/", "M", "O", "N", "&", "S", "U", "N","2", "D", "/", "M", "O", "N", "&", "S", "U", "N")))
})
Hazel233/Useful-R-Packages documentation built on Dec. 31, 2020, 12:59 p.m.