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

Function TestInt64Slice

go/fory/slice_primitive_test.go:312–348  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

310}
311
312func TestInt64Slice(t *testing.T) {
313 f := NewFory(WithXlang(false), WithCompatible(false))
314
315 t.Run("int64_slice_large_numbers", func(t *testing.T) {
316 slice := []int64{1, -2, 3, -4, math.MaxInt64, math.MinInt64}
317 data, err := f.Serialize(slice)
318 assert.NoError(t, err)
319
320 var result []int64
321 err = testDeserialize(t, f, data, &result)
322 assert.NoError(t, err)
323 assert.Equal(t, slice, result)
324 })
325
326 t.Run("int64_slice_empty", func(t *testing.T) {
327 slice := []int64{}
328 data, err := f.Serialize(slice)
329 assert.NoError(t, err)
330
331 var result []int64
332 err = testDeserialize(t, f, data, &result)
333 assert.NoError(t, err)
334 assert.NotNil(t, result)
335 assert.Empty(t, result)
336 })
337
338 t.Run("int64_slice_nil", func(t *testing.T) {
339 var slice []int64 = nil
340 data, err := f.Serialize(slice)
341 assert.NoError(t, err)
342
343 var result []int64
344 err = testDeserialize(t, f, data, &result)
345 assert.NoError(t, err)
346 assert.Nil(t, result)
347 })
348}
349
350func TestUint16Slice(t *testing.T) {
351 f := NewFory(WithXlang(false), WithCompatible(false))

Callers

nothing calls this directly

Calls 7

SerializeMethod · 0.95
NewForyFunction · 0.85
WithXlangFunction · 0.85
WithCompatibleFunction · 0.85
testDeserializeFunction · 0.85
EqualMethod · 0.45
EmptyMethod · 0.45

Tested by

no test coverage detected