(t *testing.T)
| 419 | } |
| 420 | |
| 421 | func TestPartialBatchCodec_Encode(t *testing.T) { |
| 422 | tests := []struct { |
| 423 | name string |
| 424 | msg *message.Batch |
| 425 | }{ |
| 426 | { |
| 427 | name: "simple", |
| 428 | msg: &message.Batch{ |
| 429 | Type: primitive.BatchTypeLogged, |
| 430 | Children: []*message.BatchChild{ |
| 431 | {Query: "select * from table1"}, |
| 432 | {Id: []byte{0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8}}, |
| 433 | }, |
| 434 | }, |
| 435 | }, |
| 436 | { |
| 437 | name: "positional values", |
| 438 | msg: &message.Batch{ |
| 439 | Type: primitive.BatchTypeLogged, |
| 440 | Children: []*message.BatchChild{ |
| 441 | { |
| 442 | Query: "select * from table1", |
| 443 | Values: []*primitive.Value{ |
| 444 | { |
| 445 | Type: primitive.ValueTypeRegular, |
| 446 | Contents: []byte{0x1, 0x2, 0x3}, |
| 447 | }, |
| 448 | { |
| 449 | Type: primitive.ValueTypeRegular, |
| 450 | Contents: []byte{0x4, 0x5, 0x6}, |
| 451 | }, |
| 452 | }, |
| 453 | }, |
| 454 | { |
| 455 | Id: []byte{0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8}, |
| 456 | Values: []*primitive.Value{ |
| 457 | { |
| 458 | Type: primitive.ValueTypeRegular, |
| 459 | Contents: []byte{0x1, 0x2, 0x3}, |
| 460 | }, |
| 461 | { |
| 462 | Type: primitive.ValueTypeRegular, |
| 463 | Contents: []byte{0x4, 0x5, 0x6}, |
| 464 | }, |
| 465 | }, |
| 466 | }, |
| 467 | }, |
| 468 | }, |
| 469 | }, |
| 470 | { |
| 471 | name: "consistency", |
| 472 | msg: &message.Batch{ |
| 473 | Type: primitive.BatchTypeLogged, |
| 474 | Children: []*message.BatchChild{ |
| 475 | {Query: "select * from table1"}, |
| 476 | {Id: []byte{0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8}}, |
| 477 | }, |
| 478 | Consistency: primitive.ConsistencyLevelEachQuorum, |
nothing calls this directly
no test coverage detected