MCPcopy Create free account
hub / github.com/kubernetes/test-infra / equalAPIArray

Function equalAPIArray

experiment/coverage/apicoverage_test.go:27–50  ·  view source on GitHub ↗

NOTE: This method is for avoiding flake tests instead of using reflect.DeepEqual()

(a, b apiArray)

Source from the content-addressed store, hash-verified

25
26// NOTE: This method is for avoiding flake tests instead of using reflect.DeepEqual()
27func equalAPIArray(a, b apiArray) bool {
28 if a == nil && b == nil {
29 return true
30 }
31 if a == nil || b == nil {
32 return false
33 }
34 if len(a) != len(b) {
35 return false
36 }
37 for _, i := range a {
38 found := false
39 for _, j := range b {
40 if i.Method == j.Method && i.URL == j.URL {
41 found = true
42 break
43 }
44 }
45 if !found {
46 return false
47 }
48 }
49 return true
50}
51
52func TestParseOpenAPI(t *testing.T) {
53 testCases := []struct {

Callers 5

TestParseOpenAPIFunction · 0.85
TestParseE2eAPILogFunction · 0.85
TestParseAPIServerLogFunction · 0.85
TestGetTestedAPIsFunction · 0.85
TestGetTestedAPIsByLevelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected