(t *testing.T)
| 3416 | } |
| 3417 | |
| 3418 | func 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 | |
| 3440 | func TestEnvHintWindows(t *testing.T) { |
| 3441 | if runtime.GOOS == "windows" && os.Getenv("PSHOME") == "" { |
nothing calls this directly
no test coverage detected