7
7
//!
8
8
//! [1]: https://github.com/dtolnay/trybuild?tab=readme-ov-file#workflow
9
9
10
- // Enable the module below to get syntax highlighting and code completion.
10
+ // Enable the 'pass' module below to get syntax highlighting and code completion.
11
11
// Adjust the list of modules to enable syntax highlighting and code completion.
12
- // Unfortunately tests in subfolders aren't automatically included.
12
+ // Unfortunately tests in sub-folders aren't automatically included.
13
13
//
14
- // #[allow(dead_code)]
15
- // mod good {
16
- // mod attributes_enum;
17
- // mod attributes_struct;
18
- // mod basic;
14
+ // Similar to the above 'pass' module, enable the 'fail' module below to get
15
+ // syntax highlighting and code completion. You will need to comment them out
16
+ // again but before running tests, otherwise compilation will fail (as expected).
17
+ #[ allow( dead_code) ]
18
+ mod default {
19
+ // mod pass {
20
+ // mod attributes_enum;
21
+ // mod attributes_struct;
22
+ // mod basic;
19
23
20
- // #[cfg(feature = "k8s")]
21
- // mod crd;
22
- // mod deprecate;
23
- // mod rename;
24
- // mod skip_from_version;
25
- // }
24
+ // mod deprecate;
25
+ // mod rename;
26
+ // mod skip_from_version;
27
+ // }
26
28
27
- // Similar to the above module, enable the module below to get syntax
28
- // highlighting and code completion. You will need to comment them out again but
29
- // before running tests, orherwise compilation will fail (as expected).
30
- //
31
- // #[allow(dead_code)]
32
- // mod bad {
33
- // mod deprecate;
34
- // mod skip_from_all;
35
- // mod skip_from_version;
36
- // }
29
+ // mod fail {
30
+ // mod deprecate;
31
+ // mod skip_from_all;
32
+ // mod skip_from_version;
33
+ // }
34
+ }
37
35
38
36
#[ test]
39
37
fn default_macros ( ) {
@@ -42,9 +40,22 @@ fn default_macros() {
42
40
t. compile_fail ( "tests/default/fail/*.rs" ) ;
43
41
}
44
42
43
+ #[ cfg( feature = "k8s" ) ]
44
+ #[ allow( dead_code) ]
45
+ mod k8s {
46
+ // mod pass {
47
+ // mod crd;
48
+ // }
49
+
50
+ // mod fail {
51
+ // mod crd;
52
+ // }
53
+ }
54
+
45
55
#[ cfg( feature = "k8s" ) ]
46
56
#[ test]
47
57
fn k8s_macros ( ) {
48
58
let t = trybuild:: TestCases :: new ( ) ;
49
- t. pass ( "tests/k8s/*.rs" ) ;
59
+ t. pass ( "tests/k8s/pass/*.rs" ) ;
60
+ t. compile_fail ( "tests/k8s/fail/*.rs" ) ;
50
61
}
0 commit comments