MCPcopy
hub / github.com/urfave/cli / TestCommand_VersionPrinter

Function TestCommand_VersionPrinter

command_test.go:2208–2223  ·  command_test.go::TestCommand_VersionPrinter
(t *testing.T)

Source from the content-addressed store, hash-verified

2206}
2207
2208func TestCommand_VersionPrinter(t *testing.T) {
2209 oldPrinter := VersionPrinter
2210 defer func() {
2211 VersionPrinter = oldPrinter
2212 }()
2213
2214 wasCalled := false
2215 VersionPrinter = func(*Command) {
2216 wasCalled = true
2217 }
2218
2219 cmd := &Command{}
2220 ShowVersion(cmd)
2221
2222 assert.True(t, wasCalled, "Version printer expected to be called, but was not")
2223}
2224
2225func TestCommand_CommandNotFound(t *testing.T) {
2226 counts := &opCounts{}

Callers

nothing calls this directly

Calls 1

ShowVersionFunction · 0.85

Tested by

no test coverage detected