(t *testing.T)
| 342 | } |
| 343 | |
| 344 | func TestAllocatingByteSliceTarget(t *testing.T) { |
| 345 | var dst []byte |
| 346 | sink := AllocatingByteSliceSink(&dst) |
| 347 | |
| 348 | inBytes := []byte("some bytes") |
| 349 | sink.SetBytes(inBytes) |
| 350 | if want := "some bytes"; string(dst) != want { |
| 351 | t.Errorf("SetBytes resulted in %q; want %q", dst, want) |
| 352 | } |
| 353 | v, err := sink.view() |
| 354 | if err != nil { |
| 355 | t.Fatalf("view after SetBytes failed: %v", err) |
| 356 | } |
| 357 | if &inBytes[0] == &dst[0] { |
| 358 | t.Error("inBytes and dst share memory") |
| 359 | } |
| 360 | if &inBytes[0] == &v.b[0] { |
| 361 | t.Error("inBytes and view share memory") |
| 362 | } |
| 363 | if &dst[0] == &v.b[0] { |
| 364 | t.Error("dst and view share memory") |
| 365 | } |
| 366 | } |
| 367 | |
| 368 | // orderedFlightGroup allows the caller to force the schedule of when |
| 369 | // orig.Do will be called. This is useful to serialize calls such |
nothing calls this directly
no test coverage detected
searching dependent graphs…