Files
silo-server/internal/scanner/audio_extensions_test.go
T
RXWatcherandClaude Opus 4.7 5f1ca3f825 feat(audiobooks): add audio-extension recognizer for scanner
Mirrors the existing videoExtensions/SupportsVideoFile pair. Used by
upcoming audiobook and podcast scanner branches to filter directory
walks.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 13:28:40 +02:00

25 lines
486 B
Go

package scanner
import "testing"
func TestSupportsAudioFile(t *testing.T) {
cases := []struct {
path string
want bool
}{
{"book.m4b", true},
{"chapter1.mp3", true},
{"audio.M4A", true},
{"sample.flac", true},
{"podcast.opus", true},
{"poster.jpg", false},
{"movie.mkv", false},
{"", false},
}
for _, tc := range cases {
if got := SupportsAudioFile(tc.path); got != tc.want {
t.Errorf("SupportsAudioFile(%q) = %v, want %v", tc.path, got, tc.want)
}
}
}