Use snapshots instead of matching on parts of the output

Personally I liked that the test was only dependent on what really matters, the lack of presence of a particular filename. Now the test would fail if Cargo one day adds more (generated) files to the package.

Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
This commit is contained in:
Sebastian Thiel 2024-12-24 08:03:16 +01:00 committed by GitHub
parent 2c3f8d87c4
commit af92c4445b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 2 deletions

View File

@ -4249,6 +4249,13 @@ fn simple_with_fifo() {
// would also be read eventually.
git_project
.cargo("package -l")
.with_stdout_does_not_contain("blocks-when-read")
.with_stdout_data(str![[r#"
.cargo_vcs_info.json
Cargo.lock
Cargo.toml
Cargo.toml.orig
src/main.rs
"#]])
.run();
}

View File

@ -6899,6 +6899,12 @@ fn simple_with_fifo() {
// Avoid actual blocking even in case of failure, assuming that what it lists here
// would also be read eventually.
p.cargo("package -l")
.with_stdout_does_not_contain("blocks-when-read")
.with_stdout_data(str![[r#"
Cargo.lock
Cargo.toml
Cargo.toml.orig
src/main.rs
"#]])
.run();
}