From 08dabb06b23788488e6e9db5d25f4b3f900b28a8 Mon Sep 17 00:00:00 2001 From: Thomas Zahner Date: Fri, 18 Jul 2025 17:49:18 +0200 Subject: [PATCH] Add regression test --- fixtures/TEST_LOCAL_DIRECTORIES.md | 6 ++++++ lychee-bin/tests/cli.rs | 12 ++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 fixtures/TEST_LOCAL_DIRECTORIES.md diff --git a/fixtures/TEST_LOCAL_DIRECTORIES.md b/fixtures/TEST_LOCAL_DIRECTORIES.md new file mode 100644 index 0000000..187107e --- /dev/null +++ b/fixtures/TEST_LOCAL_DIRECTORIES.md @@ -0,0 +1,6 @@ +The following links should all be valid and be detected as such by lychee. + +[link to root dir](file:///) +[link to /dev](file:///dev/) +[link to current dir](.) +[relative link to docs](../docs/) diff --git a/lychee-bin/tests/cli.rs b/lychee-bin/tests/cli.rs index 2dba8f1..472b299 100644 --- a/lychee-bin/tests/cli.rs +++ b/lychee-bin/tests/cli.rs @@ -280,6 +280,18 @@ mod cli { ) } + #[test] + fn test_local_directories() -> Result<()> { + test_json_output!( + "TEST_LOCAL_DIRECTORIES.md", + MockResponseStats { + total: 4, + successful: 4, + ..MockResponseStats::default() + } + ) + } + #[test] fn test_email() -> Result<()> { test_json_output!(