mirror of
https://gitee.com/johng/gf
synced 2026-06-06 02:25:47 +08:00
fix: gutil.IsMap judgment logic error (#2953)
This commit is contained in:
committed by
GitHub
parent
e684eae878
commit
ef1e18df19
@ -9,6 +9,7 @@ package gvar_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/container/gvar"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
)
|
||||
@ -144,6 +145,10 @@ func TestVar_IsMap(t *testing.T) {
|
||||
t.Assert(g.NewVar(int8(1)).IsMap(), false)
|
||||
t.Assert(g.NewVar(uint8(1)).IsMap(), false)
|
||||
})
|
||||
gtest.C(t, func(t *gtest.T) {
|
||||
t.Assert(gvar.New(gvar.New("asd")).IsMap(), false)
|
||||
t.Assert(gvar.New(&g.Map{"k": "v"}).IsMap(), true)
|
||||
})
|
||||
}
|
||||
|
||||
func TestVar_IsStruct(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user