From 29adf414bf1ab3469f1b6450e70242e3b5efad4d Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 28 Aug 2025 12:06:09 +0200 Subject: [PATCH] Add test for making sure URL inputs always get checked Related to https://github.com/lycheeverse/lychee/issues/1819 --- lychee-bin/tests/cli.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lychee-bin/tests/cli.rs b/lychee-bin/tests/cli.rs index dd07c3e59b..6ff06d1895 100644 --- a/lychee-bin/tests/cli.rs +++ b/lychee-bin/tests/cli.rs @@ -2722,4 +2722,21 @@ mod cli { .stdout(contains("https://example.com/glob_dir/ts")) .stdout(contains("https://example.com/glob_dir/md")); } + + /// URLs specified on the command line should also always be checked. + /// For example, sitemap URLs often end with `.xml` which is not + /// a file extension we would check by default. + #[test] + fn test_url_inputs_always_get_checked_no_matter_their_extension() { + let url_input = "https://example.com/sitemap.xml"; + + main_command() + .arg("--verbose") + .arg("--dump") + .arg(url_input) + .assert() + .success() + .stderr("") // Ensure stderr is empty + .stdout(contains("https://example.com/sitemap.xml")); + } }