Skip to content

Commit

Permalink
Fix path dumps under windows
Browse files Browse the repository at this point in the history
  • Loading branch information
notriddle committed Jul 29, 2021
1 parent 9e37513 commit 69e1945
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ fn mdbook_cli_can_correctly_test_a_passing_book() {
let mut cmd = Command::cargo_bin("mdbook").unwrap();
cmd.arg("test").current_dir(temp.path());
cmd.assert().success()
.stderr(predicates::str::is_match(r##"Testing file: "([^"]+)/src/README.md""##).unwrap())
.stderr(predicates::str::is_match(r##"Testing file: "([^"]+)/src/intro.md""##).unwrap())
.stderr(predicates::str::is_match(r##"Testing file: "([^"]+)/first/index.md""##).unwrap())
.stderr(predicates::str::is_match(r##"Testing file: "([^"]+)/first/nested.md""##).unwrap())
.stderr(predicates::str::is_match(r##"Testing file: "([^"]+)[\\/]README.md""##).unwrap())
.stderr(predicates::str::is_match(r##"Testing file: "([^"]+)[\\/]intro.md""##).unwrap())
.stderr(predicates::str::is_match(r##"Testing file: "([^"]+)[\\/]first[\\/]index.md""##).unwrap())
.stderr(predicates::str::is_match(r##"Testing file: "([^"]+)[\\/]first[\\/]nested.md""##).unwrap())
.stderr(predicates::str::is_match(r##"rustdoc returned an error:\n\n"##).unwrap().not())
.stderr(predicates::str::is_match(r##"Nested_Chapter::Rustdoc_include_works_with_anchors_too \(line \d+\) ... FAILED"##).unwrap().not());
}
Expand All @@ -27,10 +27,10 @@ fn mdbook_cli_detects_book_with_failing_tests() {
let mut cmd = Command::cargo_bin("mdbook").unwrap();
cmd.arg("test").current_dir(temp.path());
cmd.assert().failure()
.stderr(predicates::str::is_match(r##"Testing file: "([^"]+)/src/README.md""##).unwrap())
.stderr(predicates::str::is_match(r##"Testing file: "([^"]+)/src/intro.md""##).unwrap())
.stderr(predicates::str::is_match(r##"Testing file: "([^"]+)/first/index.md""##).unwrap())
.stderr(predicates::str::is_match(r##"Testing file: "([^"]+)/first/nested.md""##).unwrap())
.stderr(predicates::str::is_match(r##"Testing file: "([^"]+)[\\/]README.md""##).unwrap())
.stderr(predicates::str::is_match(r##"Testing file: "([^"]+)[\\/]intro.md""##).unwrap())
.stderr(predicates::str::is_match(r##"Testing file: "([^"]+)[\\/]first[\\/]index.md""##).unwrap())
.stderr(predicates::str::is_match(r##"Testing file: "([^"]+)[\\/]first[\\/]nested.md""##).unwrap())
.stderr(predicates::str::is_match(r##"rustdoc returned an error:\n\n"##).unwrap())
.stderr(predicates::str::is_match(r##"Nested_Chapter::Rustdoc_include_works_with_anchors_too \(line \d+\) ... FAILED"##).unwrap());
}
Expand All @@ -46,9 +46,10 @@ fn mdbook_cli_dummy_book_generates_index_html() {
cmd.arg("build").current_dir(temp.path());
cmd.assert()
.success()
.stderr(predicates::str::contains(
r##"[ERROR] (mdbook::preprocess::links): Stack depth exceeded in first/recursive.md."##,
))
.stderr(
predicates::str::is_match(r##"Stack depth exceeded in first[\\/]recursive.md."##)
.unwrap(),
)
.stderr(predicates::str::contains(
r##"[INFO] (mdbook::book): Running the html backend"##,
));
Expand Down

0 comments on commit 69e1945

Please sign in to comment.