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

Function TestArrayEachIndividually

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

Source from the content-addressed store, hash-verified

724}
725
726func TestArrayEachIndividually(t *testing.T) {
727 fory := NewFory(WithXlang(true), WithCompatible(false), WithRefTracking(true))
728 for _, srcAny := range commonArray() {
729 srcType := reflect.TypeOf(srcAny)
730 t.Logf("Testing type: %v", srcType)
731 endPtr := reflect.New(srcType)
732 data, err := fory.Marshal(srcAny)
733 require.NoError(t, err, "Marshal failed for type %v", srcType)
734 err = fory.Unmarshal(data, endPtr.Interface())
735 require.NoError(t, err, "Unmarshal failed for type %v", srcType)
736 endVal := endPtr.Elem()
737 endAny := endVal.Interface()
738 require.Equal(t, srcAny, endAny)
739 }
740}
741
742func TestSliceEachIndividually(t *testing.T) {
743 fory := NewFory(WithXlang(true), WithCompatible(false), WithRefTracking(true))

Callers

nothing calls this directly

Calls 8

MarshalMethod · 0.95
UnmarshalMethod · 0.95
NewForyFunction · 0.85
WithXlangFunction · 0.85
WithCompatibleFunction · 0.85
WithRefTrackingFunction · 0.85
commonArrayFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected