(t *testing.T)
| 333 | } |
| 334 | |
| 335 | func TestBoxMemoryType(t *testing.T) { |
| 336 | ctx := log.Testing(t) |
| 337 | ty := box.NewType(reflect.TypeOf(Memory{})) |
| 338 | got, _ := json.MarshalIndent(ty, "", " ") |
| 339 | expect := `{ |
| 340 | "type_id": 1, |
| 341 | "Ty": { |
| 342 | "Struct": { |
| 343 | "fields": [ |
| 344 | { |
| 345 | "type": { |
| 346 | "Ty": { |
| 347 | "Pointer": true |
| 348 | } |
| 349 | }, |
| 350 | "name": "P" |
| 351 | }, |
| 352 | { |
| 353 | "type": { |
| 354 | "Ty": { |
| 355 | "Slice": true |
| 356 | } |
| 357 | }, |
| 358 | "name": "S" |
| 359 | } |
| 360 | ] |
| 361 | } |
| 362 | } |
| 363 | }` |
| 364 | assert.For(ctx, "NewType(Struct)").ThatString(got).Equals(expect) |
| 365 | } |
| 366 | |
| 367 | func TestBoxUnboxMemory(t *testing.T) { |
| 368 | ctx := log.Testing(t) |
nothing calls this directly
no test coverage detected