MCPcopy Index your code
hub / github.com/abiosoft/ishell / TestHelpText

Function TestHelpText

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

Source from the content-addressed store, hash-verified

78}
79
80func TestHelpText(t *testing.T) {
81 cmd := newCmd("root", "help for root command")
82 cmd.AddCmd(newCmd("child1", "help for child1 command"))
83 cmd.AddCmd(newCmd("child2", "help for child2 command"))
84 res := cmd.HelpText()
85 expected := "\nhelp for root command\n\nCommands:\n child1 help for child1 command\n child2 help for child2 command\n\n"
86 assert.Equal(t, res, expected)
87}
88
89func TestChildrenSortedAlphabetically(t *testing.T) {
90 cmd := newCmd("root", "help for root command")

Callers

nothing calls this directly

Calls 3

newCmdFunction · 0.85
HelpTextMethod · 0.65
AddCmdMethod · 0.45

Tested by

no test coverage detected