@@ -198,7 +198,7 @@ fn prepare_for_2018() {
198
198
}
199
199
200
200
#[ cargo_test]
201
- fn fix_tests ( ) {
201
+ fn do_not_fix_tests ( ) {
202
202
let p = project ( )
203
203
. file (
204
204
"src/lib.rs" ,
@@ -220,6 +220,36 @@ fn fix_tests() {
220
220
p. cargo ( "fix --allow-no-vcs" )
221
221
. with_stderr_data ( str![ [ r#"
222
222
[CHECKING] foo v0.0.1 ([ROOT]/foo)
223
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
224
+
225
+ "# ] ] )
226
+ . with_stdout_data ( "" )
227
+ . run ( ) ;
228
+ }
229
+
230
+ #[ cargo_test]
231
+ fn fix_tests_with_edition ( ) {
232
+ let p = project ( )
233
+ . file (
234
+ "src/lib.rs" ,
235
+ r#"
236
+ pub fn foo() {}
237
+
238
+ #[cfg(test)]
239
+ mod tests {
240
+ #[test]
241
+ fn it_works() {
242
+ let mut x = 3;
243
+ x;
244
+ }
245
+ }
246
+ "# ,
247
+ )
248
+ . build ( ) ;
249
+
250
+ p. cargo ( "fix --edition-idioms --allow-no-vcs" )
251
+ . with_stderr_data ( str![ [ r#"
252
+ [CHECKING] foo v0.0.1 ([ROOT]/foo)
223
253
[FIXED] src/lib.rs (1 fix)
224
254
[WARNING] path statement with no effect
225
255
--> src/lib.rs:9:25
@@ -747,19 +777,6 @@ fn does_not_warn_about_dirty_ignored_files() {
747
777
p. cargo ( "fix" ) . run ( ) ;
748
778
}
749
779
750
- #[ cargo_test]
751
- fn fix_all_targets_by_default ( ) {
752
- let p = project ( )
753
- . file ( "src/lib.rs" , "pub fn foo() { let mut x = 3; let _ = x; }" )
754
- . file ( "tests/foo.rs" , "pub fn foo() { let mut x = 3; let _ = x; }" )
755
- . build ( ) ;
756
- p. cargo ( "fix --allow-no-vcs" )
757
- . env ( "__CARGO_FIX_YOLO" , "1" )
758
- . run ( ) ;
759
- assert ! ( !p. read_file( "src/lib.rs" ) . contains( "let mut x" ) ) ;
760
- assert ! ( !p. read_file( "tests/foo.rs" ) . contains( "let mut x" ) ) ;
761
- }
762
-
763
780
#[ cargo_test]
764
781
fn prepare_for_unstable ( ) {
765
782
// During the period where a new edition is coming up, but not yet stable,
0 commit comments