gomu/playingbar_test.go
raziman 662029970d resizeable progress bar
small refactor
2020-08-22 14:59:10 +08:00

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)
}
}