(t *testing.T)
| 52 | } |
| 53 | |
| 54 | func TestBool(t *testing.T) { |
| 55 | result := Bool("nonexistent", true) |
| 56 | Parse() |
| 57 | |
| 58 | if *result != true { |
| 59 | t.Fatalf("expected result=true, got result=%t", *result) |
| 60 | } |
| 61 | |
| 62 | err := os.Setenv("bool-key", "true") |
| 63 | if err != nil { |
| 64 | t.Fatal("unexpected error", err) |
| 65 | } |
| 66 | |
| 67 | result = Bool("bool-key", false) |
| 68 | Parse() |
| 69 | |
| 70 | if *result != true { |
| 71 | t.Fatalf("expected result=true, got result=%t", *result) |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | func TestBoolVar(t *testing.T) { |
| 76 | var result bool |