Files
wehub-resource-sync ead81af521
CI / go (push) Waiting to run
CI / build (darwin, macos-14) (push) Waiting to run
CI / build (windows, windows-2025) (push) Waiting to run
Deploy to GitHub Pages / deploy (push) Failing after 0s
chore: import upstream snapshot with attribution
2026-07-13 12:31:13 +08:00

40 lines
787 B
Go

package player
import "testing"
func TestIsHLS(t *testing.T) {
if !isHLS(".m3u8") {
t.Error(".m3u8 should be HLS")
}
for _, ext := range []string{".mp3", ".m3u", ".aac", ""} {
if isHLS(ext) {
t.Errorf("%q should not be HLS", ext)
}
}
}
func TestNeedsFFmpeg(t *testing.T) {
tests := []struct {
ext string
want bool
}{
{ext: ".aac", want: true},
{ext: ".aacp", want: true},
{ext: ".opus", want: true},
{ext: ".mp3", want: false},
{ext: ".ogg", want: false},
}
for _, tt := range tests {
if got := needsFFmpeg(tt.ext); got != tt.want {
t.Errorf("needsFFmpeg(%q) = %v, want %v", tt.ext, got, tt.want)
}
}
}
func TestSupportedExtsIncludesAACP(t *testing.T) {
if !SupportedExts[".aacp"] {
t.Fatal("SupportedExts[.aacp] = false, want true")
}
}