mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-14 20:22:20 +08:00
test(context): improve panic test message for non-existent key
This commit is contained in:
parent
309d0be834
commit
0ca191dada
@ -253,7 +253,9 @@ func TestContextSetGet(t *testing.T) {
|
|||||||
assert.False(t, err)
|
assert.False(t, err)
|
||||||
|
|
||||||
assert.Equal(t, "bar", c.MustGet("foo"))
|
assert.Equal(t, "bar", c.MustGet("foo"))
|
||||||
assert.Panics(t, func() { c.MustGet("no_exist") })
|
assert.Panicsf(t, func() {
|
||||||
|
c.MustGet("no_exist")
|
||||||
|
}, "key no_exist does not exist")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestContextSetGetAnyKey(t *testing.T) {
|
func TestContextSetGetAnyKey(t *testing.T) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user