diff options
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)) + } + }) } |