Skip to content

Commit

Permalink
avoid extra nesting
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico authored Oct 24, 2024
1 parent 46325ab commit d7d83e6
Showing 1 changed file with 15 additions and 22 deletions.
37 changes: 15 additions & 22 deletions tests/testthat/test-commented_code_linter.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,27 +104,20 @@ test_that("commented_code_linter can detect operators in comments and lint corre
)
})

test_that(
"commented_code_linter can detect commented code ending with a base pipe",
{
skip_if_not_r_version("4.1.0")

expect_lint(
"# f() |>",
rex::rex("Remove commented code."),
commented_code_linter()
)
}
)
test_that("commented_code_linter can detect commented code ending with a base pipe", {
skip_if_not_r_version("4.1.0")

expect_lint(
"# f() |>",
rex::rex("Remove commented code."),
commented_code_linter()
)
})

test_that(
"commented_code_linter can detect commented code ending with a {magrittr} pipe",
{
expect_lint(
"# f() %>%",
rex::rex("Remove commented code."),
commented_code_linter()
)
}
)
test_that("commented_code_linter can detect commented code ending with a {magrittr} pipe", {
expect_lint(
"# f() %>%",
rex::rex("Remove commented code."),
commented_code_linter()
)
})

0 comments on commit d7d83e6

Please sign in to comment.