MCPcopy
hub / github.com/moonD4rk/HackBrowserData / assertBrowsers

Function assertBrowsers

browser/browser_test.go:419–436  ·  view source on GitHub ↗

assertBrowsers flattens installations into (browser, profile) pairs and verifies they match expectations (order-independent).

(t *testing.T, browsers []Browser, wantNames, wantProfiles []string)

Source from the content-addressed store, hash-verified

417// assertBrowsers flattens installations into (browser, profile) pairs and
418// verifies they match expectations (order-independent).
419func 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}

Callers 1

runPickTestsFunction · 0.85

Calls 2

ProfilesMethod · 0.65
BrowserNameMethod · 0.65

Tested by

no test coverage detected