mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 08:32:40 +08:00
structs
This commit is contained in:
21
structs/struct_test.go
Normal file
21
structs/struct_test.go
Normal file
@ -0,0 +1,21 @@
|
||||
package structs_test
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/charlienet/go-mixed/structs"
|
||||
"github.com/go-playground/assert/v2"
|
||||
)
|
||||
|
||||
func TestNew(t *testing.T) {
|
||||
o := struct {
|
||||
Field1Name string
|
||||
}{Field1Name: "field 1 name"}
|
||||
|
||||
s := structs.New(o)
|
||||
assert.Equal(t, reflect.Struct, s.Kind())
|
||||
|
||||
t.Log(s.Names())
|
||||
t.Log(s.Values())
|
||||
}
|
Reference in New Issue
Block a user