Skip to content

Commit c009b32

Browse files
committed
tests(fix): Snapshot fixes
1 parent a9ee3e8 commit c009b32

File tree

1 file changed

+38
-23
lines changed

1 file changed

+38
-23
lines changed

tests/testsuite/fix.rs

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,9 +1297,9 @@ fn fix_to_broken_code() {
12971297
.with_stderr_contains("[WARNING] failed to automatically apply fixes [..]")
12981298
.run();
12991299

1300-
assert_eq!(
1300+
assert_e2e().eq(
13011301
p.read_file("bar/src/lib.rs"),
1302-
"pub fn foo() { let x = 3; let _ = x; }"
1302+
str!["pub fn foo() { let x = 3; let _ = x; }"],
13031303
);
13041304
}
13051305

@@ -1320,7 +1320,10 @@ fn fix_with_common() {
13201320

13211321
p.cargo("fix --edition --allow-no-vcs").run();
13221322

1323-
assert_eq!(p.read_file("tests/common/mod.rs"), "pub fn r#try() {}");
1323+
assert_e2e().eq(
1324+
p.read_file("tests/common/mod.rs"),
1325+
str!["pub fn r#try() {}"],
1326+
);
13241327
}
13251328

13261329
#[cargo_test]
@@ -2312,9 +2315,10 @@ edition = "2021"
23122315
",
23132316
)
23142317
.run();
2315-
assert_eq!(
2318+
assert_e2e().eq(
23162319
p.read_file("Cargo.toml"),
2317-
r#"
2320+
str![[r#"
2321+
23182322
cargo-features = ["edition2024"]
23192323
23202324
# Before project
@@ -2323,7 +2327,8 @@ cargo-features = ["edition2024"]
23232327
name = "foo"
23242328
edition = "2021"
23252329
# After project table
2326-
"#
2330+
2331+
"#]],
23272332
);
23282333
}
23292334

@@ -2365,9 +2370,10 @@ edition = "2021"
23652370
",
23662371
)
23672372
.run();
2368-
assert_eq!(
2373+
assert_e2e().eq(
23692374
p.read_file("Cargo.toml"),
2370-
r#"
2375+
str![[r#"
2376+
23712377
cargo-features = ["edition2024"]
23722378
23732379
# Before package
@@ -2376,7 +2382,8 @@ cargo-features = ["edition2024"]
23762382
name = "foo"
23772383
edition = "2021"
23782384
# After project table
2379-
"#
2385+
2386+
"#]],
23802387
);
23812388
}
23822389

@@ -2469,9 +2476,10 @@ a = {path = "a", default_features = false}
24692476
",
24702477
)
24712478
.run();
2472-
assert_eq!(
2479+
assert_e2e().eq(
24732480
p.read_file("Cargo.toml"),
2474-
r#"
2481+
str![[r#"
2482+
24752483
cargo-features = ["edition2024"]
24762484
24772485
[workspace.dependencies]
@@ -2519,7 +2527,8 @@ a = {path = "a", default-features = false}
25192527
# After build_dependencies line
25202528
a = {path = "a", default-features = false}
25212529
# After build_dependencies table
2522-
"#,
2530+
2531+
"#]],
25232532
);
25242533
}
25252534

@@ -2564,9 +2573,10 @@ target-dep = { version = "0.1.0", optional = true }
25642573
",
25652574
)
25662575
.run();
2567-
assert_eq!(
2576+
assert_e2e().eq(
25682577
p.read_file("Cargo.toml"),
2569-
r#"
2578+
str![[r#"
2579+
25702580
[package]
25712581
name = "foo"
25722582
version = "0.1.0"
@@ -2585,7 +2595,8 @@ target-dep = { version = "0.1.0", optional = true }
25852595
bar = ["dep:bar"]
25862596
baz = ["dep:baz"]
25872597
target-dep = ["dep:target-dep"]
2588-
"#
2598+
2599+
"#]],
25892600
);
25902601
}
25912602

@@ -2633,9 +2644,10 @@ target-dep = ["dep:target-dep"]
26332644
",
26342645
)
26352646
.run();
2636-
assert_eq!(
2647+
assert_e2e().eq(
26372648
p.read_file("Cargo.toml"),
2638-
r#"
2649+
str![[r#"
2650+
26392651
[package]
26402652
name = "foo"
26412653
version = "0.1.0"
@@ -2654,7 +2666,8 @@ target-dep = { version = "0.1.0", optional = true }
26542666
target-dep = ["dep:target-dep"]
26552667
bar = ["dep:bar"]
26562668
baz = ["dep:baz"]
2657-
"#
2669+
2670+
"#]],
26582671
);
26592672
}
26602673

@@ -2777,11 +2790,12 @@ dep_df_false = { version = "0.1.0", default-features = false }
27772790
)
27782791
.run();
27792792

2780-
assert_eq!(p.read_file("pkg_default/Cargo.toml"), pkg_default);
2781-
assert_eq!(p.read_file("pkg_df_true/Cargo.toml"), pkg_df_true);
2782-
assert_eq!(
2793+
assert_e2e().eq(p.read_file("pkg_default/Cargo.toml"), pkg_default);
2794+
assert_e2e().eq(p.read_file("pkg_df_true/Cargo.toml"), pkg_df_true);
2795+
assert_e2e().eq(
27832796
p.read_file("pkg_df_false/Cargo.toml"),
2784-
r#"
2797+
str![[r#"
2798+
27852799
[package]
27862800
name = "pkg_df_false"
27872801
version = "0.1.0"
@@ -2801,6 +2815,7 @@ dep_df_false = { workspace = true, default-features = false }
28012815
dep_simple = { workspace = true}
28022816
dep_df_true = { workspace = true}
28032817
dep_df_false = { workspace = true, default-features = false }
2804-
"#
2818+
2819+
"#]],
28052820
);
28062821
}

0 commit comments

Comments
 (0)