|
1 | 1 | test_that("pipe is indended correctly", { |
2 | | - expect_warning(test_collection("indention_operators", |
| 2 | + expect_no_warning(test_collection("indention_operators", |
3 | 3 | "pipe", |
4 | 4 | transformer = style_text |
5 | | - ), NA) |
| 5 | + )) |
6 | 6 | }) |
7 | 7 |
|
8 | 8 | test_that("base pipe is indended correctly", { |
9 | 9 | skip_if(getRversion() < "4.1") |
10 | | - expect_warning(test_collection("indention_operators", |
| 10 | + expect_no_warning(test_collection("indention_operators", |
11 | 11 | "base_pipe", |
12 | 12 | transformer = style_text |
13 | | - ), NA) |
| 13 | + )) |
14 | 14 | }) |
15 | 15 |
|
16 | 16 | test_that("mathematical operators are indended correctly", { |
17 | | - expect_warning(test_collection("indention_operators", |
| 17 | + expect_no_warning(test_collection("indention_operators", |
18 | 18 | "plus_minus", |
19 | 19 | transformer = style_op |
20 | | - ), NA) |
| 20 | + )) |
21 | 21 |
|
22 | | - expect_warning(test_collection("indention_operators", |
| 22 | + expect_no_warning(test_collection("indention_operators", |
23 | 23 | "multiply_divide", |
24 | 24 | transformer = style_op |
25 | | - ), NA) |
| 25 | + )) |
26 | 26 | }) |
27 | 27 |
|
28 | 28 |
|
29 | 29 | test_that("while / for / if without curly brackets", { |
30 | | - expect_warning(test_collection("indention_operators", |
| 30 | + expect_no_warning(test_collection("indention_operators", |
31 | 31 | "while_for_if_without_curly_non_strict", |
32 | 32 | transformer = style_text, strict = FALSE |
33 | | - ), NA) |
34 | | - expect_warning(test_collection("indention_operators", |
| 33 | + )) |
| 34 | + expect_no_warning(test_collection("indention_operators", |
35 | 35 | "while_for_without_curly_same_line_non_strict", |
36 | 36 | transformer = style_text, strict = FALSE |
37 | | - ), NA) |
| 37 | + )) |
38 | 38 |
|
39 | | - expect_warning(test_collection("indention_operators", |
| 39 | + expect_no_warning(test_collection("indention_operators", |
40 | 40 | "if-else-no-braces-not-strict", |
41 | 41 | transformer = style_text, strict = FALSE |
42 | | - ), NA) |
| 42 | + )) |
43 | 43 | }) |
44 | 44 |
|
45 | 45 | test_that("function multiline without curly brackets", { |
46 | | - expect_warning(test_collection("indention_operators", |
| 46 | + expect_no_warning(test_collection("indention_operators", |
47 | 47 | "function-multiline-no-braces-strict", |
48 | 48 | transformer = style_text, strict = TRUE |
49 | | - ), NA) |
50 | | - expect_warning(test_collection("indention_operators", |
| 49 | + )) |
| 50 | + expect_no_warning(test_collection("indention_operators", |
51 | 51 | "function-multiline-no-braces-non-strict", |
52 | 52 | transformer = style_text, strict = FALSE |
53 | | - ), NA) |
| 53 | + )) |
54 | 54 | }) |
55 | 55 |
|
56 | 56 | test_that("while / for / if without curly brackets", { |
57 | | - expect_warning(test_collection("indention_operators", |
| 57 | + expect_no_warning(test_collection("indention_operators", |
58 | 58 | "while_for_if_without_curly_strict", |
59 | 59 | transformer = style_text, strict = TRUE |
60 | | - ), NA) |
| 60 | + )) |
61 | 61 | }) |
62 | 62 |
|
63 | 63 |
|
64 | 64 | test_that("nested for and indention", { |
65 | | - expect_warning( |
| 65 | + expect_no_warning( |
66 | 66 | test_collection("indention_operators", |
67 | 67 | "nested-for-spacing-scope-indention", |
68 | 68 | transformer = style_text, scope = "indention" |
69 | | - ), |
70 | | - NA |
| 69 | + ) |
71 | 70 | ) |
72 | 71 |
|
73 | | - expect_warning( |
| 72 | + expect_no_warning( |
74 | 73 | test_collection("indention_operators", |
75 | 74 | "nested-for-spacing-scope-spaces", |
76 | 75 | transformer = style_text, scope = "spaces" |
77 | | - ), |
78 | | - NA |
| 76 | + ) |
79 | 77 | ) |
80 | 78 | }) |
81 | 79 |
|
82 | 80 | test_that("logical, special EQ_SUB and EQ_ASSIGN tokens are indented correctly", { |
83 | | - expect_warning(test_collection("indention_operators", |
| 81 | + expect_no_warning(test_collection("indention_operators", |
84 | 82 | "logical_special", |
85 | 83 | transformer = style_text, scope = "line_breaks" |
86 | | - ), NA) |
| 84 | + )) |
87 | 85 |
|
88 | | - expect_warning(test_collection("indention_operators", |
| 86 | + expect_no_warning(test_collection("indention_operators", |
89 | 87 | "eq_assign", |
90 | 88 | transformer = style_text |
91 | | - ), NA) |
92 | | - expect_warning(test_collection("indention_operators", |
| 89 | + )) |
| 90 | + expect_no_warning(test_collection("indention_operators", |
93 | 91 | "eq_formal_simple", |
94 | 92 | transformer = style_text |
95 | | - ), NA) |
| 93 | + )) |
96 | 94 | }) |
97 | 95 |
|
98 | 96 | test_that("dollar is indented and spaced correctly", { |
99 | | - expect_warning(test_collection("indention_operators", |
| 97 | + expect_no_warning(test_collection("indention_operators", |
100 | 98 | "dollar", |
101 | 99 | transformer = style_text |
102 | | - ), NA) |
| 100 | + )) |
103 | 101 | }) |
104 | 102 |
|
105 | 103 | test_that( |
106 | 104 | "code is indented correctly if not first pontial trigger causes indention", |
107 | 105 | { |
108 | | - expect_warning( |
| 106 | + expect_no_warning( |
109 | 107 | test_collection( |
110 | 108 | "indention_operators", "not_first_trigger", |
111 | 109 | transformer = style_text |
112 | | - ), |
113 | | - NA |
| 110 | + ) |
114 | 111 | ) |
115 | 112 | } |
116 | 113 | ) |
117 | 114 |
|
118 | 115 | test_that("indents eq_sub correctly with various levels of scope", { |
119 | | - expect_warning(test_collection("indention_operators", |
| 116 | + expect_no_warning(test_collection("indention_operators", |
120 | 117 | "eq_sub_complex_indention", |
121 | 118 | transformer = style_text, scope = "indention" |
122 | | - ), NA) |
| 119 | + )) |
123 | 120 |
|
124 | | - expect_warning(test_collection("indention_operators", |
| 121 | + expect_no_warning(test_collection("indention_operators", |
125 | 122 | "eq_sub_complex_tokens", |
126 | 123 | transformer = style_text, scope = "tokens" |
127 | | - ), NA) |
| 124 | + )) |
128 | 125 | }) |
129 | 126 |
|
130 | 127 | test_that("indents eq_formals correctly with various levels of scope", { |
131 | | - expect_warning(test_collection("indention_operators", |
| 128 | + expect_no_warning(test_collection("indention_operators", |
132 | 129 | "eq_formals_complex_indention", |
133 | 130 | transformer = style_text, scope = "indention" |
134 | | - ), NA) |
| 131 | + )) |
135 | 132 |
|
136 | | - expect_warning(test_collection("indention_operators", |
| 133 | + expect_no_warning(test_collection("indention_operators", |
137 | 134 | "eq_formals_complex_tokens", |
138 | 135 | transformer = style_text, scope = "tokens" |
139 | | - ), NA) |
| 136 | + )) |
140 | 137 | }) |
141 | 138 |
|
142 | 139 | test_that("tilde causes indention and is flattened out", { |
143 | | - expect_warning(test_collection("indention_operators", |
| 140 | + expect_no_warning(test_collection("indention_operators", |
144 | 141 | "tilde", |
145 | 142 | transformer = style_text |
146 | | - ), NA) |
| 143 | + )) |
147 | 144 | }) |
148 | 145 |
|
149 | 146 |
|
150 | 147 | test_that("overall", { |
151 | | - expect_warning(test_collection("indention_operators", |
| 148 | + expect_no_warning(test_collection("indention_operators", |
152 | 149 | "overall", |
153 | 150 | transformer = style_text |
154 | | - ), NA) |
| 151 | + )) |
155 | 152 | }) |
0 commit comments