MCPcopy Create free account
hub / github.com/untitaker/hyperlink / test_dead_link

Function test_dead_link

tests/cli.rs:7–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5
6#[test]
7fn test_dead_link() {
8 let site = assert_fs::TempDir::new().unwrap();
9 site.child("index.html")
10 .write_str("<a href=bar.html>")
11 .unwrap();
12 let mut cmd = Command::new(cargo::cargo_bin!("hyperlink"));
13 cmd.current_dir(site.path()).arg(".");
14
15 cmd.assert().failure().code(1).stdout(
16 predicate::str::is_match(
17 r#"^Reading files
18Checking 1 links from 1 files \(1 documents\)
19\..index\.html
20 error: bad link /bar.html
21
22Found 1 bad links
23"#,
24 )
25 .unwrap(),
26 );
27 site.close().unwrap();
28}
29
30#[test]
31fn test_dead_anchor() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…