-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create a new test collection instead of modifying existing tests
- Loading branch information
1 parent
a59d4bb
commit e843fd5
Showing
18 changed files
with
190 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,12 +59,3 @@ while (TRUE){ | |
|
||
while (TRUE){# | ||
} | ||
|
||
|
||
for (i in 1:10) {} | ||
|
||
|
||
|
||
|
||
|
||
while (TRUE) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,9 +53,3 @@ while (TRUE) { | |
|
||
while (TRUE) { # | ||
} | ||
|
||
|
||
for (i in 1:10) {} | ||
|
||
|
||
while (TRUE) {} |
20 changes: 0 additions & 20 deletions
20
tests/testthat/line_breaks_and_other/pipe_and_comment-in.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,2 @@ | ||
1:10 %>% # sum | ||
sum() | ||
|
||
|
||
f %>% g() | ||
|
||
|
||
|
||
|
||
|
||
h %>% i() | ||
|
||
|
||
|
||
|
||
|
||
# some comment | ||
|
||
|
||
|
||
|
||
j %>% k() |
12 changes: 0 additions & 12 deletions
12
tests/testthat/line_breaks_and_other/pipe_and_comment-out.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,2 @@ | ||
1:10 %>% # sum | ||
sum() | ||
|
||
|
||
f %>% g() | ||
|
||
|
||
h %>% i() | ||
|
||
|
||
# some comment | ||
|
||
|
||
j %>% k() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,6 @@ call( | |
1 | ||
) | ||
|
||
|
||
|
||
|
||
|
||
call( | ||
x = 2, | ||
1, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,6 @@ call( | |
1 | ||
) | ||
|
||
|
||
|
||
|
||
|
||
call( | ||
x = 2, | ||
1, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
1 + 1 | ||
} | ||
|
||
|
||
|
||
|
||
|
||
### some comment | ||
|
||
|
||
|
||
|
||
{ | ||
NULL | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
1 + 1 | ||
} | ||
|
||
|
||
### some comment | ||
|
||
|
||
{ | ||
NULL | ||
} |
20 changes: 20 additions & 0 deletions
20
tests/testthat/line_breaks_top_level_exprs/conditionals-in.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
for (i in 1:10) {} | ||
|
||
|
||
|
||
|
||
|
||
|
||
# some comment | ||
|
||
|
||
|
||
|
||
|
||
while (TRUE) {} | ||
|
||
|
||
|
||
|
||
# some comment | ||
if (TRUE) NULL |
11 changes: 11 additions & 0 deletions
11
tests/testthat/line_breaks_top_level_exprs/conditionals-out.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
for (i in 1:10) {} | ||
|
||
|
||
# some comment | ||
|
||
|
||
while (TRUE) {} | ||
|
||
|
||
# some comment | ||
if (TRUE) NULL |
23 changes: 23 additions & 0 deletions
23
tests/testthat/line_breaks_top_level_exprs/function_defs_and_calls-in.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
f <- function() NULL | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
g <- function() NULL | ||
|
||
|
||
|
||
|
||
f() | ||
|
||
# comment | ||
|
||
|
||
|
||
|
||
|
||
g() |
12 changes: 12 additions & 0 deletions
12
tests/testthat/line_breaks_top_level_exprs/function_defs_and_calls-out.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
f <- function() NULL | ||
|
||
|
||
g <- function() NULL | ||
|
||
|
||
f() | ||
|
||
# comment | ||
|
||
|
||
g() |
23 changes: 23 additions & 0 deletions
23
tests/testthat/line_breaks_top_level_exprs/non_strict-in.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
f <- function() NULL | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
g <- function() NULL | ||
|
||
|
||
|
||
|
||
f() | ||
|
||
# comment | ||
|
||
|
||
|
||
|
||
|
||
g() |
12 changes: 12 additions & 0 deletions
12
tests/testthat/line_breaks_top_level_exprs/non_strict-out.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
f <- function() NULL | ||
|
||
|
||
g <- function() NULL | ||
|
||
|
||
f() | ||
|
||
# comment | ||
|
||
|
||
g() |
21 changes: 21 additions & 0 deletions
21
tests/testthat/line_breaks_top_level_exprs/piped_chains-in.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
|
||
f %>% g() | ||
|
||
|
||
|
||
|
||
|
||
|
||
h %>% i() | ||
|
||
|
||
|
||
|
||
|
||
# some comment | ||
|
||
|
||
|
||
|
||
j %>% k() |
10 changes: 10 additions & 0 deletions
10
tests/testthat/line_breaks_top_level_exprs/piped_chains-out.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
f %>% g() | ||
|
||
|
||
h %>% i() | ||
|
||
|
||
# some comment | ||
|
||
|
||
j %>% k() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
test_that("extra line breaks between conditional statements are removed", { | ||
expect_no_warning( | ||
test_collection("line_breaks_top_level_exprs", "conditionals", transformer = style_text) | ||
) | ||
}) | ||
|
||
test_that("extra line breaks between function and definitions and calls are removed", { | ||
expect_no_warning( | ||
test_collection("line_breaks_top_level_exprs", "function_defs_and_calls", transformer = style_text) | ||
) | ||
}) | ||
|
||
test_that("extra line breaks between piped chains are removed", { | ||
expect_no_warning( | ||
test_collection("line_breaks_top_level_exprs", "piped_chains", transformer = style_text) | ||
) | ||
}) | ||
|
||
test_that("extra line breaks between braced expressions are removed", { | ||
expect_no_warning( | ||
test_collection("line_breaks_top_level_exprs", "braces", transformer = style_text) | ||
) | ||
}) | ||
|
||
test_that("extra line breaks are not removed in non-strict mode", { | ||
expect_no_warning( | ||
test_collection("line_breaks_top_level_exprs", "non_strict", transformer = style_text) | ||
) | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters