MCPcopy
hub / github.com/abiosoft/ishell / TestChildrenSortedAlphabetically

Function TestChildrenSortedAlphabetically

command_test.go:89–96  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

87}
88
89func TestChildrenSortedAlphabetically(t *testing.T) {
90 cmd := newCmd("root", "help for root command")
91 cmd.AddCmd(newCmd("child2", "help for child1 command"))
92 cmd.AddCmd(newCmd("child1", "help for child2 command"))
93 children := cmd.Children()
94 assert.Equal(t, children[0].Name, "child1", "must be first")
95 assert.Equal(t, children[1].Name, "child2", "must be second")
96}

Callers

nothing calls this directly

Calls 3

newCmdFunction · 0.85
ChildrenMethod · 0.80
AddCmdMethod · 0.45

Tested by

no test coverage detected