(t *testing.T)
| 23 | ) |
| 24 | |
| 25 | func TestMaterializeIteratorError(t *testing.T) { |
| 26 | ctx := context.TODO() |
| 27 | wantErr := errors.New("unique") |
| 28 | errIt := newTestIterator(false, wantErr) |
| 29 | |
| 30 | // This tests that we properly return 0 results and the error when the |
| 31 | // underlying iterator returns an error. |
| 32 | mIt := NewMaterialize(errIt) |
| 33 | |
| 34 | if mIt.Next(ctx) != false { |
| 35 | t.Errorf("Materialize iterator did not pass through underlying 'false'") |
| 36 | } |
| 37 | if mIt.Err() != wantErr { |
| 38 | t.Errorf("Materialize iterator did not pass through underlying Err") |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | func TestMaterializeIteratorErrorAbort(t *testing.T) { |
| 43 | ctx := context.TODO() |
nothing calls this directly
no test coverage detected