(t *testing.T)
| 245 | } |
| 246 | |
| 247 | func TestFormatExperimentSkipMessage(t *testing.T) { |
| 248 | tests := []struct { |
| 249 | name string |
| 250 | runID int64 |
| 251 | experiment string |
| 252 | variant string |
| 253 | wantSubstr string |
| 254 | }{ |
| 255 | { |
| 256 | name: "experiment only message", |
| 257 | runID: 12345, |
| 258 | experiment: "style", |
| 259 | variant: "", |
| 260 | wantSubstr: `experiment "style" not assigned`, |
| 261 | }, |
| 262 | { |
| 263 | name: "experiment and variant message", |
| 264 | runID: 12345, |
| 265 | experiment: "style", |
| 266 | variant: "concise", |
| 267 | wantSubstr: `not assigned variant "concise"`, |
| 268 | }, |
| 269 | { |
| 270 | name: "run id is included", |
| 271 | runID: 99999, |
| 272 | experiment: "caveman", |
| 273 | variant: "", |
| 274 | wantSubstr: "99999", |
| 275 | }, |
| 276 | } |
| 277 | |
| 278 | for _, tt := range tests { |
| 279 | t.Run(tt.name, func(t *testing.T) { |
| 280 | got := formatExperimentSkipMessage(tt.runID, tt.experiment, tt.variant) |
| 281 | assert.Contains(t, got, tt.wantSubstr, "formatExperimentSkipMessage output mismatch") |
| 282 | }) |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | func TestDeriveLastSelectedVariant(t *testing.T) { |
| 287 | tests := []struct { |
nothing calls this directly
no test coverage detected