put helpers last
This commit is contained in:
@@ -11,28 +11,6 @@ import (
|
||||
"go.senan.xyz/gonic/jukebox"
|
||||
)
|
||||
|
||||
func newJukebox(tb testing.TB) *jukebox.Jukebox {
|
||||
tb.Helper()
|
||||
|
||||
sockPath := filepath.Join(tb.TempDir(), "mpv.sock")
|
||||
|
||||
j := jukebox.New()
|
||||
err := j.Start(
|
||||
sockPath,
|
||||
[]string{jukebox.MPVArg("--ao", "null")},
|
||||
)
|
||||
if errors.Is(err, jukebox.ErrMPVTooOld) {
|
||||
tb.Skip("old mpv found, skipping")
|
||||
}
|
||||
if err != nil {
|
||||
tb.Fatalf("start jukebox: %v", err)
|
||||
}
|
||||
tb.Cleanup(func() {
|
||||
j.Quit()
|
||||
})
|
||||
return j
|
||||
}
|
||||
|
||||
func TestPlaySkipReset(t *testing.T) {
|
||||
t.Skip("bit flakey currently")
|
||||
|
||||
@@ -187,6 +165,28 @@ func TestVolume(t *testing.T) {
|
||||
require.Equal(t, 0.0, vol)
|
||||
}
|
||||
|
||||
func newJukebox(tb testing.TB) *jukebox.Jukebox {
|
||||
tb.Helper()
|
||||
|
||||
sockPath := filepath.Join(tb.TempDir(), "mpv.sock")
|
||||
|
||||
j := jukebox.New()
|
||||
err := j.Start(
|
||||
sockPath,
|
||||
[]string{jukebox.MPVArg("--ao", "null")},
|
||||
)
|
||||
if errors.Is(err, jukebox.ErrMPVTooOld) {
|
||||
tb.Skip("old mpv found, skipping")
|
||||
}
|
||||
if err != nil {
|
||||
tb.Fatalf("start jukebox: %v", err)
|
||||
}
|
||||
tb.Cleanup(func() {
|
||||
j.Quit()
|
||||
})
|
||||
return j
|
||||
}
|
||||
|
||||
func testPath(path string) string {
|
||||
cwd, _ := os.Getwd()
|
||||
return filepath.Join(cwd, "testdata", path)
|
||||
|
||||
Reference in New Issue
Block a user