Skip to content

Commit e385865

Browse files
committed
Add test for multiple lints
1 parent cde104e commit e385865

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/testthat/test-sort_linter.R

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ test_that("sort_linter produces customized warning message", {
5151
rex::rex("sort(x, decreasing = FALSE, na.last = TRUE) is better than x[order(x, decreasing = FALSE)]."),
5252
linter
5353
)
54+
})
5455

56+
test_that("sort_linter works with expression with lint > 1", {
57+
linter <- sort_linter()
5558

59+
expect_lint(
60+
"c(
61+
x[order(x, decreasing = TRUE)],
62+
y[order(y, decreasing = TRUE, na.last = FALSE)]
63+
)",
64+
lint_message <- rex::rex("sort(", anything, ") is better than"),
65+
linter
66+
)
5667
})

0 commit comments

Comments
 (0)