Add rAudio detection and MPD playback support
This commit is contained in:
6 files changed
+96
No files matched your search
@@ -0,0 +1,27 @@
|
||||
package raudio
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"testing"
|
||||
"testing/fstest"
|
||||
)
|
||||
|
||||
func TestDetect(t *testing.T) {
|
||||
for _, tt := range []struct {
|
||||
name string
|
||||
root fstest.MapFS
|
||||
want bool
|
||||
}{
|
||||
{"installed", fstest.MapFS{"srv/http/data/system/system.conf": {}}, true},
|
||||
{"missing", fstest.MapFS{}, false},
|
||||
{"directory", fstest.MapFS{"srv/http/data/system/system.conf": {Mode: fs.ModeDir}}, false},
|
||||
{"idle handler only", fstest.MapFS{"srv/http/bash/mpdidle.sh": {}}, false},
|
||||
{"RuneAudio", fstest.MapFS{"srv/http/command/rune_shutdown": {}}, false},
|
||||
} {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := detect(tt.root); got != tt.want {
|
||||
t.Fatalf("detect() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user