Skip to content

Commit

Permalink
Test ignored files
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-zahner committed Sep 22, 2024
1 parent 0e9b653 commit 462033a
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 5 deletions.
1 change: 0 additions & 1 deletion fixtures/hidden/visible/file.md

This file was deleted.

1 change: 1 addition & 0 deletions fixtures/ignore/.ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ignored-file.md
1 change: 1 addition & 0 deletions fixtures/ignore/ignored-file.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://archlinux.org
File renamed without changes.
File renamed without changes.
File renamed without changes.
27 changes: 23 additions & 4 deletions lychee-bin/tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ mod cli {
.arg(fixtures_path().join("hidden/"))
.assert()
.success()
.stdout(contains("1 OK"));
.stdout(contains("0 Total"));
}

#[test]
Expand All @@ -483,7 +483,26 @@ mod cli {
.arg("--hidden")
.assert()
.success()
.stdout(contains("2 OK"));
.stdout(contains("1 Total"));
}

#[test]
fn test_skips_ignored_files_by_default() {
main_command()
.arg(fixtures_path().join("ignore/"))
.assert()
.success()
.stdout(contains("0 Total"));
}

#[test]
fn test_include_ignored_file() {
main_command()
.arg(fixtures_path().join("ignore/"))
.arg("--no-ignore")
.assert()
.success()
.stdout(contains("1 Total"));
}

#[tokio::test]
Expand Down Expand Up @@ -774,7 +793,7 @@ mod cli {
#[test]
fn test_lycheeignore_file() -> Result<()> {
let mut cmd = main_command();
let test_path = fixtures_path().join("ignore");
let test_path = fixtures_path().join("lycheeignore");

let cmd = cmd
.current_dir(test_path)
Expand All @@ -795,7 +814,7 @@ mod cli {
#[test]
fn test_lycheeignore_and_exclude_file() -> Result<()> {
let mut cmd = main_command();
let test_path = fixtures_path().join("ignore");
let test_path = fixtures_path().join("lycheeignore");
let excludes_path = test_path.join("normal-exclude-file");

cmd.current_dir(test_path)
Expand Down

0 comments on commit 462033a

Please sign in to comment.