sqlboiler/cmds/boil_test.go
Aaron f179ea54c8 Add tests to a lot of things.
- Clean up the outputHandler function.
2016-03-01 21:37:14 -08:00

38 lines
648 B
Go

package cmds
import "testing"
func TestBuildCommandList(t *testing.T) {
list := buildCommandList()
skips := []string{"struct", "boil"}
for _, item := range list {
for _, skipItem := range skips {
if item == skipItem {
t.Errorf("Did not expect to find: %s %#v", item, list)
}
}
}
CommandNameLoop:
for cmdName := range sqlBoilerCommands {
for _, skipItem := range skips {
if cmdName == skipItem {
continue CommandNameLoop
}
}
found := false
for _, item := range list {
if item == cmdName {
found = true
break
}
}
if !found {
t.Error("Expected to find command name:", cmdName)
}
}
}