()
| 5 | |
| 6 | #[test] |
| 7 | fn 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 |
| 18 | Checking 1 links from 1 files \(1 documents\) |
| 19 | \..index\.html |
| 20 | error: bad link /bar.html |
| 21 | |
| 22 | Found 1 bad links |
| 23 | "#, |
| 24 | ) |
| 25 | .unwrap(), |
| 26 | ); |
| 27 | site.close().unwrap(); |
| 28 | } |
| 29 | |
| 30 | #[test] |
| 31 | fn test_dead_anchor() { |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…