Skip to content

Commit 01256e7

Browse files
adapt tests
1 parent 2ed63fa commit 01256e7

19 files changed

+196
-112
lines changed

R/rules-line_break.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ add_line_break_after_pipe <- function(pd) {
5252

5353
#' Set line break for multi-line function calls
5454
#' @param pd A parse table.
55-
#' @param except_token A character vector with tokens before "'('" that do not
55+
#' @param except A character vector with tokens before "'('" that do not
5656
#' @name set_line_break_if_call_is_multi_line
5757
#' @importFrom rlang seq2
5858
NULL

man/set_line_break_if_call_is_multi_line.Rd

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/set_space_between_eq_sub_and_comma.Rd

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/indention_curly_brackets/multi_line_curly_round_spacing-in.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
b<-function(x ){
22
x <- c(1,
33
2+ 3,
4-
sin(pi) ) # FIXME add tidyverse-comliant rule to break after '('
4+
sin(pi) )
55

66
if(x > 10){
77
return("done")

tests/testthat/indention_curly_brackets/multi_line_curly_round_spacing-in_tree

Lines changed: 25 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/indention_curly_brackets/multi_line_curly_round_spacing-out.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
b <- function(x) {
2-
x <- c(1,
3-
2 + 3,
4-
sin(pi)) # FIXME add tidyverse-comliant rule to break after '('
2+
x <- c(
3+
1,
4+
2 + 3,
5+
sin(pi)
6+
)
57

68
if (x > 10) {
79
return("done")

tests/testthat/indention_multiple/curly_and_round-out.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ test_that("this is a text", {
66
{
77
call(
88
12, 1 + 1,
9-
26)
9+
26
10+
)
1011
}
1112
}))
1213

tests/testthat/indention_multiple/edge_mixed-out.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
(({
44
{
55
{
6-
c(99,
6+
c(
7+
99,
78
1 + 1, {
89
"within that suff"
9-
})
10+
}
11+
)
1012
}
1113
}
1214
}))

tests/testthat/indention_multiple/overall-out.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ a <- function(x) {
2020
26 ^ 2, # FIXME ^ operator has to be surrounded by one space (or none?!), never multiple
2121
8,
2222
7
23-
)))
23+
))
24+
)
2425

2526
call(
2627
1, 2,
2728
23 + Inf - 99, call(
2829
16
29-
))
30+
)
31+
)
3032
}
3133
# comments everywhere
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
c(call(2), 1, # choosed first function name (c) such that indention is 2.
1+
c(call(2), 1, # comment
22
29
33
)

tests/testthat/indention_multiple/round_closing_on_same_line-in_tree

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
c(call(2), 1, # choosed first function name (c) such that indention is 2.
1+
c(
2+
call(2), 1, # comment
23
29
34
)

tests/testthat/indention_operators/eq_assign-out.R

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
switch(engine,
2-
pdftex = {
1+
switch(
2+
engine,
3+
pdftex = {
34
if (any) {
45
x
56
}
67
},
7-
new = (
8-
2
9-
)) # FIXME: Add line break between parens (#125)
8+
new = (
9+
2
10+
)
11+
) # FIXME: Add line break between parens (#125)
1012

1113
{
1214
a <-

tests/testthat/indention_operators/not_first_trigger-out.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
) %>%
44
j()
55

6-
a <- c(x, y,
7-
z) %>%
6+
a <- c(
7+
x, y,
8+
z
9+
) %>%
810
k()
911

1012
a + (

tests/testthat/indention_token_dependent/token_dependent_comments-out.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ call(call( # comment
22
3, 4
33
))
44

5-
call(call(1, # comment
6-
3
5+
call(call(
6+
1, # comment
7+
3
78
))

tests/testthat/indention_token_dependent/token_dependent_complex-out.R

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,39 @@ call(call(
22
2
33
))
44

5-
call(call(1,
6-
2))
5+
call(call(
6+
1,
7+
2
8+
))
79
# multi-line: no indention based on first vall
810
call(a(b(c({
911
}))))
1012

13+
call(
14+
call(
15+
2
16+
),
17+
5
18+
)
19+
20+
1121
call(call(
12-
2),
13-
5)
14-
15-
16-
call(call(1,
17-
2, c(
18-
3
19-
)))
20-
21-
call(1,
22-
call2(3, 4, call(3,
23-
4, call(5, 6, call(
24-
2
25-
)
26-
)
27-
)
28-
)
22+
1,
23+
2, c(
24+
3
25+
)
26+
))
27+
28+
call(
29+
1,
30+
call2(3, 4, call(
31+
3,
32+
4, call(5, 6, call(
33+
2
34+
)
35+
)
36+
)
37+
)
2938
)
3039

3140
# comment lala

0 commit comments

Comments
 (0)