Make silent debug info on tests (#1765)

* make silent log on tests

* fix coverage: check end-of-line at the end of debug msg
This commit is contained in:
Dmitry Kutakov
2019-02-18 05:10:45 +03:00
committed by 田欧
parent a768f064d5
commit 31bbb10f34
5 changed files with 27 additions and 19 deletions

View File

@ -24,7 +24,9 @@ func TestBindWith(t *testing.T) {
Foo string `form:"foo"`
Bar string `form:"bar"`
}
assert.NoError(t, c.BindWith(&obj, binding.Form))
captureOutput(t, func() {
assert.NoError(t, c.BindWith(&obj, binding.Form))
})
assert.Equal(t, "foo", obj.Bar)
assert.Equal(t, "bar", obj.Foo)
assert.Equal(t, 0, w.Body.Len())