assertBrowsers flattens installations into (browser, profile) pairs and verifies they match expectations (order-independent).
(t *testing.T, browsers []Browser, wantNames, wantProfiles []string)
| 417 | // assertBrowsers flattens installations into (browser, profile) pairs and |
| 418 | // verifies they match expectations (order-independent). |
| 419 | func assertBrowsers(t *testing.T, browsers []Browser, wantNames, wantProfiles []string) { |
| 420 | t.Helper() |
| 421 | |
| 422 | var gotNames, gotProfiles []string |
| 423 | for _, b := range browsers { |
| 424 | for _, p := range b.Profiles() { |
| 425 | gotNames = append(gotNames, b.BrowserName()) |
| 426 | gotProfiles = append(gotProfiles, p.Name) |
| 427 | } |
| 428 | } |
| 429 | sort.Strings(gotNames) |
| 430 | sort.Strings(gotProfiles) |
| 431 | sort.Strings(wantNames) |
| 432 | sort.Strings(wantProfiles) |
| 433 | |
| 434 | assert.Equal(t, wantNames, gotNames) |
| 435 | assert.Equal(t, wantProfiles, gotProfiles) |
| 436 | } |
no test coverage detected