(t *testing.T)
| 497 | } |
| 498 | |
| 499 | func TestSerializeCommonReference(t *testing.T) { |
| 500 | fory := NewFory(WithXlang(true), WithCompatible(false), WithRefTracking(true)) |
| 501 | var values []any |
| 502 | values = append(values, commonSlice()...) |
| 503 | values = append(values, commonMap()...) |
| 504 | for _, data := range values { |
| 505 | value := []any{data, data} |
| 506 | bytes, err := fory.Marshal(value) |
| 507 | require.Nil(t, err) |
| 508 | var newValue []any |
| 509 | require.Nil(t, fory.Unmarshal(bytes, &newValue)) |
| 510 | require.Equal(t, unsafe.Pointer(reflect.ValueOf(newValue[0]).Pointer()), |
| 511 | unsafe.Pointer(reflect.ValueOf(newValue[1]).Pointer())) |
| 512 | require.Equal(t, newValue[0], newValue[1]) |
| 513 | } |
| 514 | } |
| 515 | |
| 516 | func TestReadBufferObjectRejectsTruncatedInBandData(t *testing.T) { |
| 517 | buf := NewByteBuffer(nil) |
nothing calls this directly
no test coverage detected