From c017b5c378b2d21828779db5a9d84a4cc920a4e0 Mon Sep 17 00:00:00 2001 From: kaiiak Date: Sat, 4 Jul 2020 23:22:41 +0800 Subject: [PATCH] add GetUint GetUint64 test method --- context_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/context_test.go b/context_test.go index ce077bc6..2ccee7d8 100644 --- a/context_test.go +++ b/context_test.go @@ -261,6 +261,18 @@ func TestContextGetInt64(t *testing.T) { assert.Equal(t, int64(42424242424242), c.GetInt64("int64")) } +func TestContextGetUint(t *testing.T) { + c, _ := CreateTestContext(httptest.NewRecorder()) + c.Set("uint", uint(1)) + assert.Equal(t, uint(1), c.GetUint("uint")) +} + +func TestContextGetUint64(t *testing.T) { + c, _ := CreateTestContext(httptest.NewRecorder()) + c.Set("uint64", uint64(18446744073709551615)) + assert.Equal(t, uint64(18446744073709551615), c.GetUint64("uint64")) +} + func TestContextGetFloat64(t *testing.T) { c, _ := CreateTestContext(httptest.NewRecorder()) c.Set("float64", 4.2)