From 2c31eee3aa3f1ec4e43bd1e9b476bafc3f81628b Mon Sep 17 00:00:00 2001 From: Samuel Moelius Date: Sat, 16 Dec 2023 20:28:13 -0500 Subject: [PATCH] Fix `markdown_link_check` test --- cargo-dylint/tests/ci.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/cargo-dylint/tests/ci.rs b/cargo-dylint/tests/ci.rs index ad79e27ab..be4043b2d 100644 --- a/cargo-dylint/tests/ci.rs +++ b/cargo-dylint/tests/ci.rs @@ -271,7 +271,7 @@ fn markdown_link_check() { let path_buf = Path::new(env!("CARGO_MANIFEST_DIR")).join("..").join(path); - Command::new("npx") + let assert = Command::new("npx") .args([ "markdown-link-check", "--config", @@ -279,8 +279,17 @@ fn markdown_link_check() { &path_buf.to_string_lossy(), ]) .current_dir(&tempdir) - .assert() - .success(); + .assert(); + let stdout = std::str::from_utf8(&assert.get_output().stdout).unwrap(); + + assert!( + stdout + .lines() + .skip_while(|line| !line.ends_with(" links checked.")) + .skip(1) + .all(|line| { line.is_empty() || line.ends_with(" → Status: 500") }), + "{stdout}" + ); } }