Skip to content

Commit 3159b4b

Browse files
committed
more tests
Signed-off-by: Doug Davis <duglin@gmail.com>
1 parent c427a31 commit 3159b4b

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/types_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,10 @@ func TestRelaxedNames(t *testing.T) {
753753
Name: "attr1-id",
754754
Type: registry.STRING,
755755
},
756+
"*": {
757+
Name: "*",
758+
Type: registry.INTEGER,
759+
},
756760
},
757761
})
758762
xNoErr(t, err)
@@ -762,13 +766,17 @@ func TestRelaxedNames(t *testing.T) {
762766
xCheck(t, err == nil, fmt.Sprintf("set foo.attr1-: %s", err))
763767
err = reg.SetSave("obj1.attr1-id", "a1-id")
764768
xCheck(t, err == nil, fmt.Sprintf("set foo.attr1-id: %s", err))
769+
err = reg.SetSave("obj1.foo-bar", 5)
770+
xCheck(t, err == nil, fmt.Sprintf("set foo.foo-bar: %s", err))
765771

766772
reg.Refresh()
767773

768774
val := reg.Get("obj1.attr1-")
769775
xCheck(t, val == "a1", fmt.Sprintf("set obj1.attr1-: %v", val))
770776
val = reg.Get("obj1.attr1-id")
771777
xCheck(t, val == "a1-id", fmt.Sprintf("set obj1.attr1-id: %v", val))
778+
val = reg.Get("obj1.foo-bar")
779+
xCheck(t, val == 5, fmt.Sprintf("set obj1.foo-bar: %v", val))
772780

773781
xHTTP(t, reg, "GET", "/model", ``, 200, `{
774782
"attributes": {
@@ -853,6 +861,10 @@ func TestRelaxedNames(t *testing.T) {
853861
"attr1-id": {
854862
"name": "attr1-id",
855863
"type": "string"
864+
},
865+
"*": {
866+
"name": "*",
867+
"type": "integer"
856868
}
857869
}
858870
}

0 commit comments

Comments
 (0)