Added tests for GetDefault

This commit is contained in:
Jimmy Pettersson 2014-09-17 11:59:36 +02:00
parent e600055457
commit c78c27d8c2

View File

@ -54,6 +54,17 @@ func TestContextSetGet(t *testing.T) {
if v != "bar" {
t.Errorf("Value should be bar, was %s", v)
}
// GetDefault
v = c.GetDefault("foo", "baz")
if v != "bar" {
t.Errorf("Value should be bar, was %s", v)
}
v = c.GetDefault("badKey", "baz")
if v != "baz" {
t.Errorf("Value should be baz, was %s", v)
}
})
r.ServeHTTP(w, req)