Add StructHasStringValue, StructHasProperty

This commit is contained in:
George Suntres
2026-04-01 21:01:00 -04:00
parent e732870865
commit 7e8cf14bb0
2 changed files with 48 additions and 0 deletions

View File

@@ -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