─── ValidateEffortParam ──────────────────────────────────────────────────────
(t *testing.T)
| 169 | // ─── ValidateEffortParam ────────────────────────────────────────────────────── |
| 170 | |
| 171 | func TestValidateEffortParam(t *testing.T) { |
| 172 | tests := []struct { |
| 173 | value string |
| 174 | wantErr bool |
| 175 | }{ |
| 176 | {"low", false}, |
| 177 | {"medium", false}, |
| 178 | {"high", false}, |
| 179 | {"extreme", true}, |
| 180 | {"HIGH", true}, |
| 181 | {"", true}, |
| 182 | } |
| 183 | for _, tt := range tests { |
| 184 | t.Run(tt.value, func(t *testing.T) { |
| 185 | err := ValidateEffortParam(tt.value) |
| 186 | if tt.wantErr { |
| 187 | assert.Error(t, err, "effort=%q should fail validation", tt.value) |
| 188 | } else { |
| 189 | assert.NoError(t, err, "effort=%q should pass validation", tt.value) |
| 190 | } |
| 191 | }) |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | // ─── ValidateTemperatureParam ───────────────────────────────────────────────── |
| 196 |
nothing calls this directly
no test coverage detected