github.com/sohaha/zlsgo@v1.7.13-0.20240501141223-10dd1a906f76/zreflect/value_test.go (about) 1 package zreflect 2 3 import ( 4 "reflect" 5 "testing" 6 7 "github.com/sohaha/zlsgo" 8 ) 9 10 func TestValue(t *testing.T) { 11 tt := zlsgo.NewTest(t) 12 13 val := ValueOf(Demo) 14 zval := NewValue(Demo) 15 gval := NewValue(val) 16 zzval := NewValue(zval) 17 18 tt.Equal(reflect.Struct, val.Kind()) 19 tt.Equal(reflect.Struct, zval.Native().Kind()) 20 tt.Equal(reflect.Struct, gval.Native().Kind()) 21 tt.Equal(reflect.Struct, zzval.Native().Kind()) 22 tt.Equal(reflect.Struct, zval.Type().Native().Kind()) 23 24 tt.Log(val.Interface()) 25 tt.Log(zval.Native().Interface()) 26 }