Adding upstream version 1.0.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
4a5c02e4d1
commit
b285fe25c2
13 changed files with 86 additions and 43 deletions
10
form_test.go
10
form_test.go
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue