(t *testing.T)
| 494 | } |
| 495 | |
| 496 | func TestLeftJoinDown(t *testing.T) { |
| 497 | iter1DefLevel := 2 |
| 498 | iter1 := &testIterator{rows: []IteratorResult{ |
| 499 | testResult("x", "A", 0, 0, 1), |
| 500 | testResult("x", "B", 0, 0, 2), |
| 501 | testResult("x", "C", 0, 0, 3), |
| 502 | }} |
| 503 | |
| 504 | // Defined at level iter2DefLevel |
| 505 | iter2DefLevel := 3 |
| 506 | iter2 := &testIterator{rows: []IteratorResult{ |
| 507 | testResult("y", "A1", 0, 0, 1, 0), |
| 508 | testResult("y", "A2", 0, 0, 1, 1), |
| 509 | testResult("y", "B1", 0, 0, 2, 0), |
| 510 | testResult("y", "B2", 0, 0, 2, 1), |
| 511 | testResult("y", "C", 0, 0, 3, 0), |
| 512 | }} |
| 513 | |
| 514 | var buf IteratorResult |
| 515 | |
| 516 | testCollector := &testCollector{ |
| 517 | reset: func(rowNumber RowNumber) { |
| 518 | buf.Reset() |
| 519 | buf.RowNumber = rowNumber |
| 520 | }, |
| 521 | collect: func(r *IteratorResult, _ any) { |
| 522 | buf.Append(r) |
| 523 | }, |
| 524 | result: func() *IteratorResult { |
| 525 | return &buf |
| 526 | }, |
| 527 | } |
| 528 | |
| 529 | expected := []IteratorResult{ |
| 530 | { |
| 531 | RowNumber: rn(0, 0, 1, 0), |
| 532 | OtherEntries: []struct { |
| 533 | Key string |
| 534 | Value interface{} |
| 535 | }{ |
| 536 | {Key: "y", Value: "A1"}, |
| 537 | {Key: "x", Value: "A"}, |
| 538 | }, |
| 539 | }, |
| 540 | { |
| 541 | RowNumber: rn(0, 0, 1, 1), |
| 542 | OtherEntries: []struct { |
| 543 | Key string |
| 544 | Value interface{} |
| 545 | }{ |
| 546 | {Key: "y", Value: "A2"}, |
| 547 | }, |
| 548 | }, |
| 549 | { |
| 550 | RowNumber: rn(0, 0, 2, 0), |
| 551 | OtherEntries: []struct { |
| 552 | Key string |
| 553 | Value interface{} |
nothing calls this directly
no test coverage detected