File tree 1 file changed +34
-0
lines changed
1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -38,3 +38,37 @@ fn clippy_force_rebuild() {
38
38
. with_stderr_contains ( "[..]assert!(true)[..]" )
39
39
. run ( ) ;
40
40
}
41
+
42
+ #[ cargo_test]
43
+ fn clippy_passes_args ( ) {
44
+ if !clippy_is_available ( ) {
45
+ return ;
46
+ }
47
+
48
+ // This is just a random clippy lint (assertions_on_constants) that
49
+ // hopefully won't change much in the future.
50
+ let p = project ( )
51
+ . file (
52
+ "Cargo.toml" ,
53
+ r#"
54
+ [package]
55
+ name = "foo"
56
+ version = "0.1.0"
57
+
58
+ [dependencies]
59
+ "# ,
60
+ )
61
+ . file ( "src/lib.rs" , "pub fn f() { assert!(true); }" )
62
+ . build ( ) ;
63
+
64
+ p. cargo ( "clippy-preview -Zunstable-options -v -- -Aclippy::assertions_on_constants" )
65
+ . masquerade_as_nightly_cargo ( )
66
+ . with_stderr_does_not_contain ( "[..]assert!(true)[..]" )
67
+ . run ( ) ;
68
+
69
+ // Make sure it runs again.
70
+ p. cargo ( "clippy-preview -Zunstable-options -v" )
71
+ . masquerade_as_nightly_cargo ( )
72
+ . with_stderr_contains ( "[..]assert!(true)[..]" )
73
+ . run ( ) ;
74
+ }
You can’t perform that action at this time.
0 commit comments