Skip to content

Commit

Permalink
Tests shouldn't fail if there are warnings
Browse files Browse the repository at this point in the history
Specifically there might be warnings about lacking
support for default packages on old Cargo
  • Loading branch information
sourcefrog committed Nov 11, 2023
1 parent 819a1ad commit af8abaa
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions tests/cli/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::fs::{self, read_to_string};
use indoc::indoc;
use itertools::Itertools;

use super::{copy_of_testdata, run, CommandInstaExt};
use super::{copy_of_testdata, run};

#[test]
fn list_warns_about_unmatched_packages() {
Expand All @@ -21,7 +21,7 @@ fn list_warns_about_unmatched_packages() {
"notapackage",
])
.assert()
.stdout(predicates::str::contains(
.stderr(predicates::str::contains(
"package \"notapackage\" not found in source tree",
))
.code(0);
Expand All @@ -33,7 +33,23 @@ fn list_files_json_workspace() {
run()
.args(["mutants", "--list-files", "--json"])
.current_dir("testdata/tree/workspace")
.assert_insta("list_files_json_workspace");
.assert()
.stdout(indoc! { r#"[
{
"package": "cargo_mutants_testdata_workspace_utils",
"path": "utils/src/lib.rs"
},
{
"package": "main",
"path": "main/src/main.rs"
},
{
"package": "main2",
"path": "main2/src/main.rs"
}
]
"# })
.success();
}

#[test]
Expand Down

0 comments on commit af8abaa

Please sign in to comment.