test_that("not_in: target item is present in vector", {
expect_false(1 %>% not_in(c(1, 2, 3, 4, "c", 6, 7, 8, "another thing", 1)))
})
test_that("not_in: target item not present in vector", {
expect_true(not_in("c", c("cows", "cat", "3", 4, 5, 6)))
})
test_that("not_in: target is not present in NULL", {
expect_true(not_in("c", NULL))
})
test_that("not_in: item not present in NA", {
expect_true(not_in("c", NA))
})
test_that("not_in: NA is not present in vector", {
expect_true(not_in(NA, c(1, 2, 3, 4, "c", 6, 7, 8, "another thing", 1)))
})
test_that("not_in: NA is present in vector", {
expect_false(not_in(NA, c(1, 2, 3, 4, "c", NA, 7, 8, "another thing", 1)))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.