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

Function TestSerializeBeginWithMagicNumber

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

Source from the content-addressed store, hash-verified

346}
347
348func TestSerializeBeginWithMagicNumber(t *testing.T) {
349 strSlice := []string{"str1", "str1", "", "", "str2"}
350 fory := NewFory(WithXlang(true), WithCompatible(false), WithRefTracking(true))
351 bytes, err := fory.Marshal(strSlice)
352 require.Nil(t, err, fmt.Sprintf("serialize value %s with type %s failed: %s",
353 reflect.ValueOf(strSlice), reflect.TypeOf(strSlice), err))
354 // Contains at least one byte for the bitmap.
355 require.True(t, len(bytes) >= 1)
356}
357
358type Foo struct {
359 F1 int32

Callers

nothing calls this directly

Calls 5

MarshalMethod · 0.95
NewForyFunction · 0.85
WithXlangFunction · 0.85
WithCompatibleFunction · 0.85
WithRefTrackingFunction · 0.85

Tested by

no test coverage detected