Skip to content

Commit

Permalink
Merge pull request #52 from mobusoperandi/all-examples-tested-non-det…
Browse files Browse the repository at this point in the history
…erministic-order

test: fix a non-deterministic test
  • Loading branch information
mightyiam authored Feb 11, 2024
2 parents c328b2f + 56a636e commit 2091e59
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 17 deletions.
44 changes: 31 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ rev = "7889630"
assert_cmd = "2.0.12"
assert_fs = "1.0.13"
indoc = "2.0.3"
predicates = "3.1.0"
9 changes: 5 additions & 4 deletions tests/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ mod util;

use assert_fs::fixture::FileWriteStr;
use indoc::{formatdoc, indoc};
use predicates::boolean::PredicateBooleanExt;
use util::with_eelco;

#[test]
Expand Down Expand Up @@ -34,9 +35,9 @@ fn all_examples_tested() {

let file_path = file.path().to_str().unwrap();

eelco.assert().success().stderr(formatdoc! {"
PASS: {file_path}:1
PASS: {file_path}:7
"});
eelco.assert().success().stderr(
predicates::str::contains(format!("PASS: {file_path}:1"))
.and(predicates::str::contains(format!("PASS: {file_path}:7"))),
);
});
}

0 comments on commit 2091e59

Please sign in to comment.