Skip to content

Commit 226615d

Browse files
add tests with pipes
1 parent e0e2ed4 commit 226615d

File tree

6 files changed

+586
-499
lines changed

6 files changed

+586
-499
lines changed

tests/testthat/line_breaks_and_other/base-pipe-line-breaks-in.R

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,18 @@ blew(y = 2, x |>
8282

8383
{a |> c() +1}
8484

85+
{
86+
87+
(
88+
89+
# some comment
90+
91+
a |> c() + 1
92+
93+
)
94+
95+
}
96+
8597
b |>
8698
f() |> # never move comment to next line as it can be styler: off or nolint
8799
k() |>

tests/testthat/line_breaks_and_other/base-pipe-line-breaks-in_tree

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

tests/testthat/line_breaks_and_other/base-pipe-line-breaks-out.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ blew(y = 2, x |>
8888
a |> c() + 1
8989
}
9090

91+
{
92+
(
93+
# some comment
94+
95+
a |> c() + 1
96+
)
97+
}
98+
9199
b |>
92100
f() |> # never move comment to next line as it can be styler: off or nolint
93101
k() |>

tests/testthat/line_breaks_and_other/comma-in.R

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,14 @@ mpg %>%
1818
, avg_hwy = mean(hwy)
1919
, n = n()
2020
, n_class = n_distinct(class))
21+
22+
23+
1:4 %>% {
24+
25+
26+
(
27+
28+
. + 1
29+
)
30+
31+
}

tests/testthat/line_breaks_and_other/comma-in_tree

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

tests/testthat/line_breaks_and_other/comma-out.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,11 @@ mpg %>%
2121
n = n(),
2222
n_class = n_distinct(class)
2323
)
24+
25+
26+
1:4 %>%
27+
{
28+
(
29+
. + 1
30+
)
31+
}

0 commit comments

Comments
 (0)