Skip to content

Commit 7219ef4

Browse files
use testthat regex expectations
1 parent 68e846d commit 7219ef4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/testthat/test-public_api.R

+7-7
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,13 @@ test_that("style_pkg() can find qmd anywhere", {
326326
filetype = ".Qmd"
327327
)
328328
)
329-
expect_false(any(grepl("hello-world.R", msg, fixed = TRUE)))
330-
expect_false(any(grepl("test-package-xyz.R", msg, fixed = TRUE)))
331-
expect_false(any(grepl("random.Rmd", msg, fixed = TRUE)))
332-
expect_false(any(grepl("random.Rmarkdown", msg, fixed = TRUE)))
333-
expect_false(any(grepl("README.Rmd", msg, fixed = TRUE)))
334-
expect_false(any(grepl("RcppExports.R", msg, fixed = TRUE)))
335-
expect_true(any(grepl("new.qmd", msg, fixed = TRUE)))
329+
expect_no_match(msg, "hello-world.R", fixed = TRUE)
330+
expect_no_match(msg, "test-package-xyz.R", fixed = TRUE)
331+
expect_no_match(msg, "random.Rmd", fixed = TRUE)
332+
expect_no_match(msg, "random.Rmarkdown", fixed = TRUE)
333+
expect_no_match(msg, "README.Rmd", fixed = TRUE)
334+
expect_no_match(msg, "RcppExports.R", fixed = TRUE)
335+
expect_match(msg, "new.qmd", fixed = TRUE)
336336
})
337337

338338

0 commit comments

Comments
 (0)