delve/command/command_test.go

20 lines
327 B
Go
Raw Normal View History

2014-05-20 21:28:24 +00:00
package command
import "testing"
func TestCommandDefault(t *testing.T) {
var (
cmds = Commands{make(map[string]cmdfunc)}
cmd = cmds.Find("non-existant-command")
)
err := cmd()
if err == nil {
t.Fatal("cmd() did not default")
}
if err.Error() != "command not available" {
t.Fatal("wrong command output")
}
}