mirror of
https://github.com/github/gh-stack.git
synced 2026-09-14 20:26:28 +08:00
22 lines
550 B
Go
22 lines
550 B
Go
package cmd
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestRootCmd_SubcommandRegistration(t *testing.T) {
|
|
root := RootCmd()
|
|
expected := []string{"init", "add", "checkout", "push", "sync", "unstack", "merge", "view", "rebase", "up", "down", "top", "bottom", "alias", "feedback", "submit"}
|
|
|
|
registered := make(map[string]bool)
|
|
for _, cmd := range root.Commands() {
|
|
registered[cmd.Name()] = true
|
|
}
|
|
|
|
for _, name := range expected {
|
|
assert.True(t, registered[name], "expected subcommand %q to be registered", name)
|
|
}
|
|
}
|