diff options
| author | RanXom <saiyedshizain@gmail.com> | 2026-07-13 01:24:33 +0530 |
|---|---|---|
| committer | RanXom <saiyedshizain@gmail.com> | 2026-07-13 01:24:33 +0530 |
| commit | 3323efbcd18ad48ff2dd8491d1830b57e8ac87dd (patch) | |
| tree | c65a11096ee5eef63d5a1a0bbfdb824a9fba71f7 /internal/scanner/scanner_test.go | |
| parent | acb7160bb7dd885ae45f762d967ddfd4be6a3d23 (diff) | |
| download | galleryd-3323efbcd18ad48ff2dd8491d1830b57e8ac87dd.tar.xz galleryd-3323efbcd18ad48ff2dd8491d1830b57e8ac87dd.zip | |
feat(scanner): deduplicate discovered files
test(scanner): add test for deduplicacy
Diffstat (limited to 'internal/scanner/scanner_test.go')
| -rw-r--r-- | internal/scanner/scanner_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/scanner/scanner_test.go b/internal/scanner/scanner_test.go index f13384a..4027d95 100644 --- a/internal/scanner/scanner_test.go +++ b/internal/scanner/scanner_test.go @@ -48,4 +48,22 @@ func TestScan(t *testing.T) { } } }) + + t.Run("Deduplicates overlapping roots", func(t *testing.T) { + root := filepath.Join("testdata", "duplicate") + + s := New([]string{ + root, + root, + }) + + files, err := s.Scan(context.Background()) + if err != nil { + t.Fatalf("Scan failed: %v", err) + } + + if len(files) != 2 { + t.Fatalf("Expected 2 unique files, got %d", len(files)) + } + }) } |