From 82652a69d5771203408670189042ab9c966bdd62 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 3 Sep 2021 01:48:50 +0200 Subject: [PATCH] Add test --- lychee-bin/tests/cli.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lychee-bin/tests/cli.rs b/lychee-bin/tests/cli.rs index 6d0819b..a0681bf 100644 --- a/lychee-bin/tests/cli.rs +++ b/lychee-bin/tests/cli.rs @@ -148,6 +148,25 @@ mod cli { .stdout(contains("Excluded.........1")); } + #[test] + fn test_resolve_paths() { + let mut cmd = main_command(); + let offline_dir = fixtures_path().join("offline"); + + // Exclude file link because it doesn't exist on the filesystem. + // (File URIs are absolute paths, which we don't have.) + // Nevertheless, the `file` scheme should be recognized. + cmd.arg("--offline") + .arg("--base") + .arg(&offline_dir) + .arg(&offline_dir.join("index.html")) + .env_clear() + .assert() + .success() + .stdout(contains("Total............2")) + .stdout(contains("Successful.......2")); + } + #[test] fn test_quirks() -> Result<()> { test_json_output!(