forked from Gitlink/gitlink-cli
27 lines
678 B
Go
27 lines
678 B
Go
package cli
|
|
|
|
import "testing"
|
|
|
|
func TestShortcutsCount(t *testing.T) {
|
|
sc := Shortcuts()
|
|
if len(sc) != 10 {
|
|
t.Fatalf("expected 10 shortcuts (list, info, run, watch, schedule, start, stop, status, logs, install-systemd), got %d", len(sc))
|
|
}
|
|
names := map[string]bool{
|
|
"list": false, "info": false, "run": false, "watch": false,
|
|
"schedule": false, "start": false, "stop": false, "status": false,
|
|
"logs": false, "install-systemd": false,
|
|
}
|
|
for _, s := range sc {
|
|
if _, ok := names[s.Name]; !ok {
|
|
t.Fatalf("unexpected shortcut: %s", s.Name)
|
|
}
|
|
names[s.Name] = true
|
|
}
|
|
for n, found := range names {
|
|
if !found {
|
|
t.Fatalf("missing shortcut: %s", n)
|
|
}
|
|
}
|
|
}
|