Fix path dumps under windows

This commit is contained in:
Michael Howell 2021-07-13 17:09:49 -07:00 committed by Eric Huss
parent 10d30a2dc0
commit 11b1e86187
1 changed files with 12 additions and 11 deletions

View File

@ -12,10 +12,10 @@ fn mdbook_cli_can_correctly_test_a_passing_book() {
let mut cmd = Command::cargo_bin("mdbook").unwrap(); let mut cmd = Command::cargo_bin("mdbook").unwrap();
cmd.arg("test").current_dir(temp.path()); cmd.arg("test").current_dir(temp.path());
cmd.assert().success() cmd.assert().success()
.stderr(predicates::str::is_match(r##"Testing file: "([^"]+)/src/README.md""##).unwrap()) .stderr(predicates::str::is_match(r##"Testing file: "([^"]+)[\\/]README.md""##).unwrap())
.stderr(predicates::str::is_match(r##"Testing file: "([^"]+)/src/intro.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[\\/]index.md""##).unwrap())
.stderr(predicates::str::is_match(r##"Testing file: "([^"]+)/first/nested.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##"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()); .stderr(predicates::str::is_match(r##"Nested_Chapter::Rustdoc_include_works_with_anchors_too \(line \d+\) ... FAILED"##).unwrap().not());
} }
@ -27,10 +27,10 @@ fn mdbook_cli_detects_book_with_failing_tests() {
let mut cmd = Command::cargo_bin("mdbook").unwrap(); let mut cmd = Command::cargo_bin("mdbook").unwrap();
cmd.arg("test").current_dir(temp.path()); cmd.arg("test").current_dir(temp.path());
cmd.assert().failure() cmd.assert().failure()
.stderr(predicates::str::is_match(r##"Testing file: "([^"]+)/src/README.md""##).unwrap()) .stderr(predicates::str::is_match(r##"Testing file: "([^"]+)[\\/]README.md""##).unwrap())
.stderr(predicates::str::is_match(r##"Testing file: "([^"]+)/src/intro.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[\\/]index.md""##).unwrap())
.stderr(predicates::str::is_match(r##"Testing file: "([^"]+)/first/nested.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##"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()); .stderr(predicates::str::is_match(r##"Nested_Chapter::Rustdoc_include_works_with_anchors_too \(line \d+\) ... FAILED"##).unwrap());
} }
@ -46,9 +46,10 @@ fn mdbook_cli_dummy_book_generates_index_html() {
cmd.arg("build").current_dir(temp.path()); cmd.arg("build").current_dir(temp.path());
cmd.assert() cmd.assert()
.success() .success()
.stderr(predicates::str::contains( .stderr(
r##"[ERROR] (mdbook::preprocess::links): Stack depth exceeded in first/recursive.md."##, predicates::str::is_match(r##"Stack depth exceeded in first[\\/]recursive.md."##)
)) .unwrap(),
)
.stderr(predicates::str::contains( .stderr(predicates::str::contains(
r##"[INFO] (mdbook::book): Running the html backend"##, r##"[INFO] (mdbook::book): Running the html backend"##,
)); ));