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

Function TestSerializeSlice

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

Source from the content-addressed store, hash-verified

164}
165
166func TestSerializeSlice(t *testing.T) {
167 for _, referenceTracking := range []bool{false, true} {
168 fory := NewFory(WithXlang(true), WithCompatible(false), WithRefTracking(referenceTracking))
169 serde(t, fory, []byte{0, 1, MaxUint8})
170 // serde(t, fory, []int8{MinInt8, -1, 0, 1, MaxInt8})
171 serde(t, fory, []int16{MinInt16, -1, 0, 1, MaxInt16})
172 serde(t, fory, []int32{MinInt32, -1, 0, 1, MaxInt32})
173 serde(t, fory, []int64{MinInt64, -1, 0, 1, MaxInt64})
174 serde(t, fory, []float32{-1.0, 0, 1.0})
175 serde(t, fory, []float64{-1.0, 0, 1.0})
176 serde(t, fory, []string{"str1", "", "str2"})
177 serde(t, fory, []any{"", "", "str", "str"})
178 serde(t, fory, primitiveData())
179 for _, data := range commonSlice() {
180 serde(t, fory, data)
181 }
182 serde(t, fory, commonSlice())
183 }
184}
185
186func TestSerializeMap(t *testing.T) {
187 for _, referenceTracking := range []bool{false, true} {

Callers

nothing calls this directly

Calls 7

NewForyFunction · 0.85
WithXlangFunction · 0.85
WithCompatibleFunction · 0.85
WithRefTrackingFunction · 0.85
serdeFunction · 0.85
primitiveDataFunction · 0.85
commonSliceFunction · 0.85

Tested by

no test coverage detected