1
0
Fork 0

Adding 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:19 +02:00
parent 4a5c02e4d1
commit b285fe25c2
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
13 changed files with 86 additions and 43 deletions

View file

@ -206,8 +206,8 @@ func performFormTest(t *testing.T, binder handlerFunc, testCase formTestCase) {
}
expString := fmt.Sprintf("%+v", testCase.expected)
actString := fmt.Sprintf("%+v", actual)
if actString != expString && !(testCase.deepEqual && reflect.DeepEqual(testCase.expected, actual)) {
assert.EqualValues(t, expString, actString)
if actString != expString && (!testCase.deepEqual || !reflect.DeepEqual(testCase.expected, actual)) {
assert.Equal(t, expString, actString)
}
}
@ -217,7 +217,7 @@ func performFormTest(t *testing.T, binder handlerFunc, testCase formTestCase) {
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)
formTestHandler(actual, errs)
})
} else {
@ -238,7 +238,7 @@ func performFormTest(t *testing.T, binder handlerFunc, testCase formTestCase) {
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)
formTestHandler(actual, errs)
})
} else {
@ -323,7 +323,7 @@ func Test_Default(t *testing.T) {
m.Get("/", func(_ http.ResponseWriter, req *http.Request) {
var f defaultForm
Bind(req, &f)
assert.EqualValues(t, "hello world", f.Default)
assert.Equal(t, "hello world", f.Default)
})
resp := httptest.NewRecorder()
req, err := http.NewRequest("GET", "/", nil)