(t *testing.T)
| 322 | } |
| 323 | |
| 324 | func TestUnregisteredStructSerializationFails(t *testing.T) { |
| 325 | value := explicitRegistrationUser{Name: "bob"} |
| 326 | |
| 327 | fory := NewFory(WithXlang(true), WithCompatible(false), WithRefTracking(false)) |
| 328 | buf := NewByteBuffer(nil) |
| 329 | err := fory.SerializeWithCallback(buf, value, nil) |
| 330 | require.Error(t, err) |
| 331 | require.Contains(t, err.Error(), "must be registered explicitly") |
| 332 | |
| 333 | fory = NewFory(WithXlang(true), WithCompatible(false), WithRefTracking(false)) |
| 334 | _, err = fory.Marshal(&value) |
| 335 | require.Error(t, err) |
| 336 | require.Contains(t, err.Error(), "must be registered explicitly") |
| 337 | } |
| 338 | |
| 339 | func TestRegisterById(t *testing.T) { |
| 340 | fory := NewFory(WithXlang(true), WithCompatible(false), WithRefTracking(false)) |
nothing calls this directly
no test coverage detected