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

Function TestUnquoteUsage

flag_test.go:3418–3438  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3416}
3417
3418func TestUnquoteUsage(t *testing.T) {
3419 tests := []struct {
3420 str string
3421 expStr string
3422 expUsage string
3423 }{
3424 {"foo", "", "foo"},
3425 {"foo something", "", "foo something"},
3426 {"foo `bar 11`", "bar 11", "foo bar 11"},
3427 {"foo `bar 11` sobar", "bar 11", "foo bar 11 sobar"},
3428 {"foo `bar 11", "", "foo `bar 11"},
3429 }
3430
3431 for i, test := range tests {
3432 t.Run(fmt.Sprintf("unquote %d", i), func(t *testing.T) {
3433 str, usage := unquoteUsage(test.str)
3434 assert.Equal(t, test.expStr, str)
3435 assert.Equal(t, test.expUsage, usage)
3436 })
3437 }
3438}
3439
3440func TestEnvHintWindows(t *testing.T) {
3441 if runtime.GOOS == "windows" && os.Getenv("PSHOME") == "" {

Callers

nothing calls this directly

Calls 2

unquoteUsageFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected