Skip to content

Commit 818a05f

Browse files
add tests
1 parent 94113b9 commit 818a05f

File tree

4 files changed

+133
-0
lines changed

4 files changed

+133
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
if (TRUE)
3+
3
4+
else
5+
4
6+
}
7+
8+
{
9+
if (TRUE) {
10+
3
11+
} else
12+
4
13+
}
14+
15+
{
16+
if (TRUE)
17+
3
18+
else {
19+
4
20+
}
21+
}
22+
23+
{
24+
if (TRUE) {
25+
3
26+
} else {
27+
4
28+
}
29+
}

tests/testthat/indention_multiple/if_else_curly-in_tree

Lines changed: 69 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
if (TRUE)
3+
3
4+
else
5+
4
6+
}
7+
8+
{
9+
if (TRUE) {
10+
3
11+
} else
12+
4
13+
}
14+
15+
{
16+
if (TRUE)
17+
3
18+
else {
19+
4
20+
}
21+
}
22+
23+
{
24+
if (TRUE) {
25+
3
26+
} else {
27+
4
28+
}
29+
}

tests/testthat/test-indention_multiple.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ test_that("multiple curly and round brackets overall test", {
3636

3737
})
3838

39+
test_that("if and ifelse interacting with curly braces works", {
40+
expect_warning(test_collection("indention_multiple",
41+
"if_else_curly",
42+
transformer = style_text,
43+
write_back = TRUE), NA)
44+
})
3945

4046
test_that("edge cases work", {
4147
expect_warning(test_collection("indention_multiple",

0 commit comments

Comments
 (0)