NOTE: This method is for avoiding flake tests instead of using reflect.DeepEqual()
(a, b apiArray)
| 25 | |
| 26 | // NOTE: This method is for avoiding flake tests instead of using reflect.DeepEqual() |
| 27 | func 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 | |
| 52 | func TestParseOpenAPI(t *testing.T) { |
| 53 | testCases := []struct { |
no outgoing calls
no test coverage detected