Commit f333f5ad authored by Daniel Sonck's avatar Daniel Sonck
Browse files

Improve tests

parent 578f04f8
......@@ -10,10 +10,8 @@ func (p Status) String() string {
switch p {
case Stopped:
return "stopped"
case Playing:
return "playing"
default:
return "invalid"
return "playing"
}
}
......
package deck
import "testing"
func TestStatus_String(t *testing.T) {
var v Status = Playing
if ans := v.String(); ans != "playing" {
t.Fatalf("Playing.String() failed. expected %v, got %v", "playing", ans)
}
v = Stopped
if ans := v.String(); ans != "stopped" {
t.Fatalf("Playing.String() failed. expected %v, got %v", "stopped", ans)
}
}
\ No newline at end of file
package main
import (
"os"
"testing"
)
func Test_main(t *testing.T) {
// Just call main help start which should work
os.Args = []string{"playlist", "help" , "start"}
main()
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment