(t *testing.T)
| 100 | } |
| 101 | |
| 102 | func TestStatusSuffix(t *testing.T) { |
| 103 | if got := (BudgetStatus{}).StatusSuffix(); got != "" { |
| 104 | t.Fatalf("zero value must render empty, got %q", got) |
| 105 | } |
| 106 | cases := []struct { |
| 107 | remaining float64 |
| 108 | want string |
| 109 | }{ |
| 110 | {1.0, " · 100% pass"}, |
| 111 | {0.73, " · 73% pass"}, |
| 112 | {0.005, " · 1% pass"}, |
| 113 | {0.0, " · 0% pass"}, |
| 114 | } |
| 115 | for _, tc := range cases { |
| 116 | got := BudgetStatus{Set: true, Remaining: tc.remaining}.StatusSuffix() |
| 117 | if got != tc.want { |
| 118 | t.Fatalf("Remaining=%v: got %q want %q", tc.remaining, got, tc.want) |
| 119 | } |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | func TestContextWindowFromHeaders(t *testing.T) { |
| 124 | cases := []struct { |
nothing calls this directly
no test coverage detected