mirror of https://github.com/gin-gonic/gin.git
Fixed tests up to master branch
This commit is contained in:
parent
7713e8157a
commit
8933874582
|
@ -230,7 +230,11 @@ func TestContextSetGet(t *testing.T) {
|
||||||
// Set
|
// Set
|
||||||
c.Set("foo", "bar")
|
c.Set("foo", "bar")
|
||||||
|
|
||||||
if v := c.Get("foo"); v != "bar" {
|
v, err := c.Get("foo")
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("Error on exist key")
|
||||||
|
}
|
||||||
|
if v != "bar" {
|
||||||
t.Errorf("Value should be bar, was %s", v)
|
t.Errorf("Value should be bar, was %s", v)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -267,7 +271,8 @@ func TestContextHTML(t *testing.T) {
|
||||||
w := httptest.NewRecorder()
|
w := httptest.NewRecorder()
|
||||||
|
|
||||||
r := Default()
|
r := Default()
|
||||||
r.HTMLTemplates = template.Must(template.New("t").Parse(`Hello {{.Name}}`))
|
templ, _ := template.New("t").Parse(`Hello {{.Name}}`)
|
||||||
|
r.SetHTMLTemplate(templ)
|
||||||
|
|
||||||
type TestData struct{ Name string }
|
type TestData struct{ Name string }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue