Skip to content

Commit 9453159

Browse files
committed
test(freshness): Update remaining unordered tests to snapbox
`compare.rs` gives priority based on expected-line length. `snapbox` gives priority according to the expected line order.
1 parent 52ec93d commit 9453159

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

tests/testsuite/freshness.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1616,21 +1616,21 @@ fn reuse_panic_pm() {
16161616

16171617
// bar is built once without panic (for proc-macro) and once with (for the
16181618
// normal dependency).
1619-
// TODO: Migrating to Snapbox might cause flakyness here. See https://github.com/rust-lang/cargo/pull/14161/files#r1660071433
1620-
#[expect(deprecated)]
16211619
p.cargo("build -v")
1622-
.with_stderr_unordered(
1623-
"\
1620+
.with_stderr_data(
1621+
str![[r#"
16241622
[LOCKING] 2 packages to latest compatible versions
1625-
[COMPILING] bar [..]
1626-
[RUNNING] `rustc --crate-name bar --edition=2015 bar/src/lib.rs [..]--crate-type lib --emit=[..]link[..]
1627-
[RUNNING] `rustc --crate-name bar --edition=2015 bar/src/lib.rs [..]--crate-type lib --emit=[..]link -C panic=abort[..]-C debuginfo=2 [..]
1628-
[COMPILING] somepm [..]
1623+
[COMPILING] bar v0.0.1 ([ROOT]/foo/bar)
1624+
[RUNNING] `rustc --crate-name bar [..] -C panic=abort [..]
1625+
[RUNNING] `rustc --crate-name bar [..]
1626+
[COMPILING] somepm v0.0.1 ([ROOT]/foo/somepm)
16291627
[RUNNING] `rustc --crate-name somepm [..]
1630-
[COMPILING] foo [..]
1631-
[RUNNING] `rustc --crate-name foo --edition=2015 src/lib.rs [..]-C panic=abort[..]
1632-
[FINISHED] [..]
1633-
",
1628+
[COMPILING] foo v0.0.1 ([ROOT]/foo)
1629+
[RUNNING] `rustc --crate-name foo [..] -C panic=abort [..]
1630+
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
1631+
1632+
"#]]
1633+
.unordered(),
16341634
)
16351635
.run();
16361636
}

tests/testsuite/freshness_checksum.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,22 +1639,22 @@ fn reuse_panic_pm() {
16391639

16401640
// bar is built once without panic (for proc-macro) and once with (for the
16411641
// normal dependency).
1642-
// TODO: Migrating to Snapbox might cause flakyness here. See https://github.com/rust-lang/cargo/pull/14161/files#r1660071433
1643-
#[expect(deprecated)]
16441642
p.cargo("build -Zchecksum-freshness -v")
16451643
.masquerade_as_nightly_cargo(&["checksum-freshness"])
1646-
.with_stderr_unordered(
1647-
"\
1644+
.with_stderr_data(
1645+
str![[r#"
16481646
[LOCKING] 2 packages to latest compatible versions
1649-
[COMPILING] bar [..]
1650-
[RUNNING] `rustc --crate-name bar --edition=2015 bar/src/lib.rs [..]--crate-type lib --emit=[..]link[..]
1651-
[RUNNING] `rustc --crate-name bar --edition=2015 bar/src/lib.rs [..]--crate-type lib --emit=[..]link -C panic=abort[..]-C debuginfo=2 [..]
1652-
[COMPILING] somepm [..]
1647+
[COMPILING] bar v0.0.1 ([ROOT]/foo/bar)
1648+
[RUNNING] `rustc --crate-name bar [..] -C panic=abort [..]
1649+
[RUNNING] `rustc --crate-name bar [..]
1650+
[COMPILING] somepm v0.0.1 ([ROOT]/foo/somepm)
16531651
[RUNNING] `rustc --crate-name somepm [..]
1654-
[COMPILING] foo [..]
1655-
[RUNNING] `rustc --crate-name foo --edition=2015 src/lib.rs [..]-C panic=abort[..]
1656-
[FINISHED] [..]
1657-
",
1652+
[COMPILING] foo v0.0.1 ([ROOT]/foo)
1653+
[RUNNING] `rustc --crate-name foo [..] -C panic=abort [..]
1654+
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
1655+
1656+
"#]]
1657+
.unordered(),
16581658
)
16591659
.run();
16601660
}

0 commit comments

Comments
 (0)