(t *testing.T)
| 311 | } |
| 312 | |
| 313 | func TestQueryRowBytesInvalidatedByNext_bytesIntoRawBytes(t *testing.T) { |
| 314 | t.Parallel() |
| 315 | replace := []byte(invalid) |
| 316 | rows := NewRows([]string{"raw"}). |
| 317 | AddRow([]byte(`one binary value with some text!`)). |
| 318 | AddRow([]byte(`two binary value with even more text than the first one`)) |
| 319 | scan := func(rs *sql.Rows) ([]byte, error) { |
| 320 | var raw sql.RawBytes |
| 321 | return raw, rs.Scan(&raw) |
| 322 | } |
| 323 | want := []struct { |
| 324 | Initial []byte |
| 325 | Replaced []byte |
| 326 | }{ |
| 327 | {Initial: []byte(`one binary value with some text!`), Replaced: replace[:len(replace)-7]}, |
| 328 | {Initial: []byte(`two binary value with even more text than the first one`), Replaced: bytes.Join([][]byte{replace, replace[:len(replace)-23]}, nil)}, |
| 329 | } |
| 330 | queryRowBytesInvalidatedByNext(t, rows, scan, want) |
| 331 | } |
| 332 | |
| 333 | func TestQueryRowBytesNotInvalidatedByNext_bytesIntoBytes(t *testing.T) { |
| 334 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…