Skip to content

Commit

Permalink
using reflect.DeepEqual to compare the expected and actual QueryParams
Browse files Browse the repository at this point in the history
  • Loading branch information
SVilgelm committed Sep 29, 2023
1 parent 7543a2f commit f92bf9f
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions middleware_test.go
Expand Up @@ -268,23 +268,9 @@ func Test_parseRequestURL(t *testing.T) {
if expectedURL.String() != actualURL.String() {
t.Errorf("r.URL = %q does not match expected %q", r.URL, tt.expectedURL)
}
if len(expectedQuery) != len(actualQuery) {
if !reflect.DeepEqual(expectedQuery, actualQuery) {
t.Errorf("r.URL = %q does not match expected %q", r.URL, tt.expectedURL)
}
for name, expected := range expectedQuery {
actual, ok := actualQuery[name]
if !ok {
t.Errorf("r.URL = %q does not match expected %q", r.URL, tt.expectedURL)
}
if len(expected) != len(actual) {
t.Errorf("r.URL = %q does not match expected %q", r.URL, tt.expectedURL)
}
for i, v := range expected {
if v != actual[i] {
t.Errorf("r.URL = %q does not match expected %q", r.URL, tt.expectedURL)
}
}
}
})
}
}
Expand Down

0 comments on commit f92bf9f

Please sign in to comment.