mirror of
https://github.com/issadarkthing/gomu.git
synced 2025-04-25 13:48:49 +08:00
44 lines
580 B
Go
44 lines
580 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func Test_NewPlayingBar(t *testing.T) {
|
|
|
|
gomu = newGomu()
|
|
p := newPlayingBar()
|
|
|
|
if p.progress == nil {
|
|
t.Errorf("chan int == nil")
|
|
}
|
|
|
|
}
|
|
|
|
func Test_NewProgress(t *testing.T) {
|
|
|
|
p := newPlayingBar()
|
|
full := 100
|
|
p.newProgress("sample", full)
|
|
|
|
if p.full != full {
|
|
t.Errorf("Expected %d; got %d", full, p.full)
|
|
}
|
|
|
|
if p._progress != 0 {
|
|
t.Errorf("Expected %d; got %d", 0, p._progress)
|
|
}
|
|
|
|
}
|
|
|
|
func Test_Stop(t *testing.T) {
|
|
|
|
p := newPlayingBar()
|
|
|
|
p.stop()
|
|
|
|
if p.skip == false {
|
|
t.Errorf("Expected %t; got %t", true, p.skip)
|
|
}
|
|
}
|