1
- //! Verifies the implementation of the style checker in [style]
1
+ //! Verifies the implementation of the style checker in [style].
2
2
3
3
use style:: StyleChecker ;
4
4
5
5
pub mod style;
6
6
7
7
#[ test]
8
- fn accept_correct_module_layout ( ) {
8
+ fn check_style_accept_correct_module_layout ( ) {
9
9
let contents = r#"
10
10
use core::mem::size_of;
11
11
pub type foo_t = u32;
@@ -24,7 +24,7 @@ pub use self::foolib::*;
24
24
}
25
25
26
26
#[ test]
27
- fn reject_incorrect_module_layout ( ) {
27
+ fn check_style_reject_incorrect_module_layout ( ) {
28
28
let contents = r#"
29
29
use core::mem::size_of;
30
30
pub type foo_t = u32;
@@ -43,7 +43,7 @@ pub use self::foolib::*;
43
43
}
44
44
45
45
#[ test]
46
- fn reject_incorrect_cfg_if_layout ( ) {
46
+ fn check_style_reject_incorrect_cfg_if_layout ( ) {
47
47
let contents = r#"
48
48
cfg_if! {
49
49
if #[cfg(foo)] {
@@ -60,7 +60,7 @@ cfg_if! {
60
60
}
61
61
62
62
#[ test]
63
- fn accept_cfg_if_branch_resets_state ( ) {
63
+ fn check_style_accept_cfg_if_branch_resets_state ( ) {
64
64
let contents = r#"
65
65
cfg_if! {
66
66
if #[cfg(foo)] {
@@ -79,7 +79,7 @@ cfg_if! {
79
79
}
80
80
81
81
#[ test]
82
- fn reject_multiple_f_macros ( ) {
82
+ fn check_style_reject_multiple_f_macros ( ) {
83
83
let contents = r#"
84
84
f! {}
85
85
f! {}
92
92
}
93
93
94
94
#[ test]
95
- fn cfg_ignore_target_endian_nested ( ) {
95
+ fn check_style_accept_cfg_ignore_target_endian_nested ( ) {
96
96
let contents = r#"
97
97
pub struct Foo {
98
98
#[cfg(target_endian = "little")]
@@ -107,7 +107,7 @@ pub struct Foo {
107
107
}
108
108
109
109
#[ test]
110
- fn reject_manual_copy ( ) {
110
+ fn check_style_reject_manual_copy ( ) {
111
111
let contents = r#"
112
112
#[derive(Copy)]
113
113
pub struct Foo {}
@@ -120,7 +120,7 @@ pub struct Foo {}
120
120
}
121
121
122
122
#[ test]
123
- fn reject_manual_clone ( ) {
123
+ fn check_style_reject_manual_clone ( ) {
124
124
let contents = r#"
125
125
#[derive(Clone)]
126
126
pub struct Foo {}
@@ -133,7 +133,7 @@ pub struct Foo {}
133
133
}
134
134
135
135
#[ test]
136
- fn accept_multiple_s_macros_with_disjoint_cfg ( ) {
136
+ fn check_style_accept_multiple_s_macros_with_disjoint_cfg ( ) {
137
137
let contents = r#"
138
138
// Main `s!`
139
139
s! {}
@@ -155,7 +155,7 @@ s! { pub struct bar { /* ... */ } }
155
155
}
156
156
157
157
#[ test]
158
- fn reject_duplicated_s_macro ( ) {
158
+ fn check_style_reject_duplicated_s_macro ( ) {
159
159
let contents = r#"
160
160
s! {}
161
161
s! {}
@@ -168,7 +168,7 @@ s! {}
168
168
}
169
169
170
170
#[ test]
171
- fn reject_duplicated_s_macro_cfg ( ) {
171
+ fn check_style_reject_duplicated_s_macro_cfg ( ) {
172
172
let contents = r#"
173
173
#[cfg(not(target_arch = "foo"))]
174
174
s! {}
@@ -184,7 +184,7 @@ s! {}
184
184
}
185
185
186
186
#[ test]
187
- fn reject_single_positive_s_macro_cfg ( ) {
187
+ fn check_style_reject_single_positive_s_macro_cfg ( ) {
188
188
let contents = r#"
189
189
// A positive (no `not`) config: reject because this should go into
190
190
// the relevant file.
@@ -199,7 +199,7 @@ s! { pub struct foo { /* ... */ } }
199
199
}
200
200
201
201
#[ test]
202
- fn reject_single_positive_s_macro_cfg_target_os ( ) {
202
+ fn check_style_reject_single_positive_s_macro_cfg_target_os ( ) {
203
203
let contents = r#"
204
204
// A positive (no `not`) config: reject because this should go into
205
205
// the relevant file.
@@ -214,7 +214,7 @@ s! { pub struct foo { /* ... */ } }
214
214
}
215
215
216
216
#[ test]
217
- fn accept_positive_s_macro_any ( ) {
217
+ fn check_style_accept_positive_s_macro_any ( ) {
218
218
let contents = r#"
219
219
// It's nicer to accept this so that we don't have to duplicate the same struct 3 times.
220
220
#[cfg(any(target_arch = "foo", target_arch = "bar", target_arch = "baz"))]
@@ -228,7 +228,7 @@ s! { pub struct foo { /* ... */ } }
228
228
}
229
229
230
230
#[ test]
231
- fn accept_positive_s_macro_all ( ) {
231
+ fn check_style_accept_positive_s_macro_all ( ) {
232
232
let contents = r#"
233
233
#[cfg(all(target_arch = "foo", target_arch = "bar", target_arch = "baz"))]
234
234
s! { pub struct foo { /* ... */ } }
@@ -241,7 +241,7 @@ s! { pub struct foo { /* ... */ } }
241
241
}
242
242
243
243
#[ test]
244
- fn reject_duplicated_cfg_and_cfg_if ( ) {
244
+ fn check_style_reject_duplicated_cfg_and_cfg_if ( ) {
245
245
let contents = r#"
246
246
#[cfg(not(target_arch = "foo"))]
247
247
s! { pub struct foo { /* ... */ } }
0 commit comments