Skip to content

Commit

Permalink
Create test-glob.R (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbarbone committed Aug 12, 2023
1 parent 370aa6e commit 95cabc5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/testthat/test-glob.R
@@ -0,0 +1,14 @@
test_that("glob() works", {
x <- c("apple", "banana", "peach", "pear", "orange")
obj <- glob(x, "*e")
exp <- c("apple", "orange")
expect_identical(obj, exp)

obj <- glob(x, "pea*", value = FALSE)
exp <- c(3L, 4L)
expect_identical(obj, exp)

obj <- glob(x, "*an*", value = NA)
exp <- c(FALSE, TRUE, FALSE, FALSE, TRUE)
expect_identical(obj, exp)
})

0 comments on commit 95cabc5

Please sign in to comment.