From 318648a4c0d9d7f4c2e14f963f15066d388281a5 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 13 Sep 2023 15:06:29 -0600 Subject: [PATCH] Fix already_failing test Some of the rust testsuite output failed and the test was a bit brittle. --- tests/cli/main.rs | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/tests/cli/main.rs b/tests/cli/main.rs index bea3bfed..abcba247 100644 --- a/tests/cli/main.rs +++ b/tests/cli/main.rs @@ -935,21 +935,19 @@ fn already_failing_tests_are_detected_before_running_mutants() { .assert() .code(4) .stdout( - predicate::str::contains("running 1 test\ntest test_factorial ... FAILED").normalize(), - ) - .stdout( - predicate::str::contains( - "thread 'test_factorial' panicked at 'assertion failed: `(left == right)` - left: `720`, - right: `72`'", - ) - .normalize(), - ) - .stdout(predicate::str::contains("lib.rs:11:5")) - .stdout(predicate::str::contains( - "cargo test failed in an unmutated tree, so no mutants were tested", - )) - .stdout(predicate::str::contains("test result: FAILED. 0 passed; 1 failed;").normalize()); + predicate::str::contains("running 1 test\ntest test_factorial ... FAILED") + .normalize() + .and(predicate::str::contains("thread 'test_factorial' panicked")) + .and(predicate::str::contains("72")) // the failing value should be in the output + .and(predicate::str::contains("lib.rs:11:5")) + .and(predicate::str::contains( + "cargo test failed in an unmutated tree, so no mutants were tested", + )) + .and( + predicate::str::contains("test result: FAILED. 0 passed; 1 failed;") + .normalize(), + ), + ); } #[test]