diff options
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/scanner/scanner_test.go | 10 | ||||
| -rw-r--r-- | internal/scanner/testdata/gallery/.secret.jpg | 0 |
2 files changed, 9 insertions, 1 deletions
diff --git a/internal/scanner/scanner_test.go b/internal/scanner/scanner_test.go index 870aab0..866b50a 100644 --- a/internal/scanner/scanner_test.go +++ b/internal/scanner/scanner_test.go @@ -43,7 +43,7 @@ func TestScanner(t *testing.T) { } }) - t.Run("skip hidden directories", func(t *testing.T) { + t.Run("skips hidden directories", func(t *testing.T) { for _, file := range files { if filepath.Base(file.Path) == "nuclearlaunchcode.txt" { t.Fatal("hidden file entered the scanner") @@ -51,6 +51,14 @@ func TestScanner(t *testing.T) { } }) + t.Run("skips hidden files", func(t *testing.T) { + for _, file := range files { + if filepath.Base(file.Path) == ".secret.jpg" { + t.Fatal("scanner returned hidden file") + } + } + }) + t.Run("deduplicates overlapping roots", func(t *testing.T) { root := filepath.Join("testdata", "duplicate") diff --git a/internal/scanner/testdata/gallery/.secret.jpg b/internal/scanner/testdata/gallery/.secret.jpg new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/internal/scanner/testdata/gallery/.secret.jpg |