MCPcopy Create free account
hub / github.com/apache/fory / TestSerializePtr

Function TestSerializePtr

go/fory/fory_test.go:150–164  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

148}
149
150func TestSerializePtr(t *testing.T) {
151 for _, referenceTracking := range []bool{false, true} {
152 fory := NewFory(WithXlang(true), WithCompatible(false), WithRefTracking(referenceTracking))
153 a := -100
154 b := &a
155 serde(t, fory, b)
156 x := "str"
157 serde(t, fory, &x)
158 x = ""
159 serde(t, fory, &x)
160 // pointer to pointer is not allowed.
161 _, err := fory.Marshal(&b)
162 require.Error(t, err)
163 }
164}
165
166func TestSerializeSlice(t *testing.T) {
167 for _, referenceTracking := range []bool{false, true} {

Callers

nothing calls this directly

Calls 7

MarshalMethod · 0.95
NewForyFunction · 0.85
WithXlangFunction · 0.85
WithCompatibleFunction · 0.85
WithRefTrackingFunction · 0.85
serdeFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected