Skip to content

Commit 658ff9e

Browse files
committed
consolidate more tests
1 parent 64c1c67 commit 658ff9e

File tree

4 files changed

+169
-364
lines changed

4 files changed

+169
-364
lines changed

any_tests/jsoniter_any_object_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,18 @@ func Test_any_within_struct(t *testing.T) {
106106
should.Equal("hello", obj.Field1.ToString())
107107
should.Equal("[1,2,3]", obj.Field2.ToString())
108108
}
109+
110+
func Test_object_wrapper_any_get_all(t *testing.T) {
111+
should := require.New(t)
112+
type TestObject struct {
113+
Field1 []int
114+
Field2 []int
115+
}
116+
any := jsoniter.Wrap(TestObject{[]int{1, 2}, []int{3, 4}})
117+
should.Contains(any.Get('*', 0).ToString(), `"Field2":3`)
118+
should.Contains(any.Keys(), "Field1")
119+
should.Contains(any.Keys(), "Field2")
120+
should.NotContains(any.Keys(), "Field3")
121+
122+
//should.Contains(any.GetObject()["Field1"].GetArray()[0], 1)
123+
}

jsoniter_object_test.go

Lines changed: 0 additions & 364 deletions
This file was deleted.

0 commit comments

Comments
 (0)