New lint: recommend `expect_match()` and `expect_no_match()`
`testthat` has `expect_match()` and `expect_no_match()` to replace `expect_true(grepl(...))` and `expect_false(grepl(...))`: https://testthat.r-lib.org/dev/reference/expect_match.html
``` r
library(testthat)
expect_true(grepl("a", "abc"))
expect_match("abc", "a")
expect_true(grepl("^a", "^abc", fixed = TRUE))
expect_match("^abc", "^a", fixed = TRUE)
expect_false(grepl("^a", "^abc"))
expect_no_match("^abc", "^a")
```
0 条评论