Fix: uint test

pull/247/head
HFO4 5 years ago
parent 4309653160
commit c867916c3a

@ -46,12 +46,12 @@ func TestGroup_AfterFind(t *testing.T) {
} }
err := testCase.AfterFind() err := testCase.AfterFind()
asserts.NoError(err) asserts.NoError(err)
asserts.Equal(testCase.PolicyList, []int{1}) asserts.Equal(testCase.PolicyList, []uint{1})
testCase.Policies = "[1,2,3,4,5]" testCase.Policies = "[1,2,3,4,5]"
err = testCase.AfterFind() err = testCase.AfterFind()
asserts.NoError(err) asserts.NoError(err)
asserts.Equal(testCase.PolicyList, []int{1, 2, 3, 4, 5}) asserts.Equal(testCase.PolicyList, []uint{1, 2, 3, 4, 5})
testCase.Policies = "[1,2,3,4,5" testCase.Policies = "[1,2,3,4,5"
err = testCase.AfterFind() err = testCase.AfterFind()
@ -60,5 +60,5 @@ func TestGroup_AfterFind(t *testing.T) {
testCase.Policies = "[]" testCase.Policies = "[]"
err = testCase.AfterFind() err = testCase.AfterFind()
asserts.NoError(err) asserts.NoError(err)
asserts.Equal(testCase.PolicyList, []int{}) asserts.Equal(testCase.PolicyList, []uint{})
} }

@ -7,18 +7,9 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
var r *gin.Engine
// SetupTestEngine 设置测试用gin.Engine
func SetupTestEngine(engine *gin.Engine) {
r = engine
}
// InitRouter 初始化路由 // InitRouter 初始化路由
func InitRouter() *gin.Engine { func InitRouter() *gin.Engine {
if r == nil { r := gin.Default()
r = gin.Default()
}
/* /*

Loading…
Cancel
Save