1
0
Fork 0

Merging upstream version 1.0.1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-05-26 05:48:23 +02:00
parent c8b00cb8af
commit 61133985ce
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
13 changed files with 86 additions and 43 deletions

View file

@ -146,7 +146,7 @@ func performJSONTest(t *testing.T, binder handlerFunc, testCase jsonTestCase) {
case "JSON":
if testCase.shouldSucceedOnJSON {
assert.Empty(t, errs, errs)
assert.EqualValues(t, fmt.Sprintf("%+v", testCase.expected), fmt.Sprintf("%+v", actual))
assert.Equal(t, fmt.Sprintf("%+v", testCase.expected), fmt.Sprintf("%+v", actual))
} else {
assert.NotEmpty(t, errs)
}
@ -155,7 +155,7 @@ func performJSONTest(t *testing.T, binder handlerFunc, testCase jsonTestCase) {
assert.Empty(t, errs, errs)
} else {
assert.NotEmpty(t, errs)
assert.EqualValues(t, fmt.Sprintf("%+v", testCase.expected), fmt.Sprintf("%+v", actual))
assert.Equal(t, fmt.Sprintf("%+v", testCase.expected), fmt.Sprintf("%+v", actual))
}
}
}
@ -167,7 +167,7 @@ func performJSONTest(t *testing.T, binder handlerFunc, testCase jsonTestCase) {
var actual []Post
errs := binder(req, &actual)
for i, a := range actual {
assert.EqualValues(t, p[i].Title, a.Title)
assert.Equal(t, p[i].Title, a.Title)
jsonTestHandler(a, errs)
}
})
@ -184,7 +184,7 @@ func performJSONTest(t *testing.T, binder handlerFunc, testCase jsonTestCase) {
m.Post(testRoute, func(_ http.ResponseWriter, req *http.Request) {
var actual Post
errs := binder(req, &actual)
assert.EqualValues(t, p.Title, actual.Title)
assert.Equal(t, p.Title, actual.Title)
jsonTestHandler(actual, errs)
})
} else {
@ -200,7 +200,7 @@ func performJSONTest(t *testing.T, binder handlerFunc, testCase jsonTestCase) {
m.Post(testRoute, func(_ http.ResponseWriter, req *http.Request) {
var actual BlogPost
errs := binder(req, &actual)
assert.EqualValues(t, p.Title, actual.Title)
assert.Equal(t, p.Title, actual.Title)
jsonTestHandler(actual, errs)
})
} else {
@ -215,7 +215,7 @@ func performJSONTest(t *testing.T, binder handlerFunc, testCase jsonTestCase) {
m.Post(testRoute, func(_ http.ResponseWriter, req *http.Request) {
var actual Group
errs := binder(req, &actual)
assert.EqualValues(t, p.Name, actual.Name)
assert.Equal(t, p.Name, actual.Name)
jsonTestHandler(actual, errs)
})
} else {
@ -250,7 +250,7 @@ func performJSONTest(t *testing.T, binder handlerFunc, testCase jsonTestCase) {
if testCase.shouldSucceedOnJSON &&
httpRecorder.Code != http.StatusOK &&
!testCase.shouldFailOnBind {
assert.EqualValues(t, http.StatusOK, httpRecorder.Code)
assert.Equal(t, http.StatusOK, httpRecorder.Code)
}
}
})