(t *testing.T)
| 323 | } |
| 324 | |
| 325 | func TestTruncatingByteSliceTarget(t *testing.T) { |
| 326 | var buf [100]byte |
| 327 | s := buf[:] |
| 328 | if err := stringGroup.Get(dummyCtx, "short", TruncatingByteSliceSink(&s)); err != nil { |
| 329 | t.Fatal(err) |
| 330 | } |
| 331 | if want := "ECHO:short"; string(s) != want { |
| 332 | t.Errorf("short key got %q; want %q", s, want) |
| 333 | } |
| 334 | |
| 335 | s = buf[:6] |
| 336 | if err := stringGroup.Get(dummyCtx, "truncated", TruncatingByteSliceSink(&s)); err != nil { |
| 337 | t.Fatal(err) |
| 338 | } |
| 339 | if want := "ECHO:t"; string(s) != want { |
| 340 | t.Errorf("truncated key got %q; want %q", s, want) |
| 341 | } |
| 342 | } |
| 343 | |
| 344 | func TestAllocatingByteSliceTarget(t *testing.T) { |
| 345 | var dst []byte |
nothing calls this directly
no test coverage detected
searching dependent graphs…