(t *testing.T)
| 107 | } |
| 108 | |
| 109 | func TestArgsParser_BoolValue(t *testing.T) { |
| 110 | p := NewArgsParser() |
| 111 | p.RegisterBool("--draft") |
| 112 | args := []string{"--draft=yes pls"} |
| 113 | rest, err := p.Parse(args) |
| 114 | equal(t, nil, err) |
| 115 | equal(t, []string{}, rest) |
| 116 | equal(t, true, p.HasReceived("--draft")) |
| 117 | equal(t, true, p.Bool("--draft")) |
| 118 | equal(t, "yes pls", p.Value("--draft")) |
| 119 | } |
| 120 | |
| 121 | func TestArgsParser_Shorthand(t *testing.T) { |
| 122 | p := NewArgsParser() |
nothing calls this directly
no test coverage detected
searching dependent graphs…