Add StructHasStringValue, StructHasProperty
This commit is contained in:
@@ -4,6 +4,22 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestStructHasProperty(t *testing.T) {
|
||||
type O struct {
|
||||
Name string
|
||||
Age int
|
||||
}
|
||||
|
||||
o := &O{
|
||||
Name: "Nick",
|
||||
Age: 15,
|
||||
}
|
||||
|
||||
if !StructHasProperty(o, "Name") {
|
||||
t.Fatal("Should have property name")
|
||||
}
|
||||
}
|
||||
|
||||
func TestStructSetValue(t *testing.T) {
|
||||
type O struct {
|
||||
Name string
|
||||
|
||||
Reference in New Issue
Block a user