Skip to content

Commit fe4d47d

Browse files
test for double braces
1 parent 0935242 commit fe4d47d

File tree

4 files changed

+41
-3
lines changed

4 files changed

+41
-3
lines changed

tests/testthat/test-token_adding_removing.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ test_that("other manipulations are correct (add braces, semi-colon etc.)", {
99
test_that("braces in if-else clause are added correctly", {
1010
expect_warning(test_collection("token_adding_removing", "if_else_strict",
1111
transformer = style_text), NA)
12-
})
13-
14-
test_that("braces in if-else clause are added correctly", {
1512
expect_warning(test_collection("token_adding_removing", "if_else_non_strict",
1613
transformer = style_text, strict = FALSE), NA)
1714
})
15+
16+
test_that("double braces are treated correctly", {
17+
expect_warning(test_collection("token_adding_removing", "double_braces",
18+
transformer = style_text), NA)
19+
})
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
if (X)
2+
return(TRUE)
3+
4+
if (X) return(FALSE)

tests/testthat/token_adding_removing/double_braces-in_tree

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
if (X) {
2+
return(TRUE)
3+
}
4+
5+
if (X) return(FALSE)

0 commit comments

Comments
 (0)