(t *testing.T)
| 164 | } |
| 165 | |
| 166 | func TestBoolP(t *testing.T) { |
| 167 | b := BoolP("bool", "b", false, "bool value in CommandLine") |
| 168 | c := BoolP("c", "c", false, "other bool value") |
| 169 | args := []string{"--bool"} |
| 170 | if err := CommandLine.Parse(args); err != nil { |
| 171 | t.Error("expected no error, got ", err) |
| 172 | } |
| 173 | if *b != true { |
| 174 | t.Errorf("expected b=true got b=%v", *b) |
| 175 | } |
| 176 | if *c != false { |
| 177 | t.Errorf("expect c=false got c=%v", *c) |
| 178 | } |
| 179 | } |