aboutsummaryrefslogtreecommitdiff
path: root/internal/scanner/scanner_test.go
diff options
context:
space:
mode:
authorRanXom <saiyedshizain@gmail.com>2026-07-13 01:54:57 +0530
committerRanXom <saiyedshizain@gmail.com>2026-07-13 01:54:57 +0530
commitdc0bd0a705c21ce7fdccbb576534d74bc9f513cc (patch)
tree3c9750961f09d1fc08927cddfb9d9feb0a2d6961 /internal/scanner/scanner_test.go
parentcaedac51246096e4358ca57ecfa32064c8c4b69e (diff)
downloadgalleryd-dc0bd0a705c21ce7fdccbb576534d74bc9f513cc.tar.xz
galleryd-dc0bd0a705c21ce7fdccbb576534d74bc9f513cc.zip
test(scanner): add test for hidden file skipping
Diffstat (limited to 'internal/scanner/scanner_test.go')
-rw-r--r--internal/scanner/scanner_test.go10
1 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")