MCPcopy
hub / github.com/cayleygraph/cayley / TestMaterializeIteratorError

Function TestMaterializeIteratorError

graph/iterator/materialize_test.go:25–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23)
24
25func 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
42func TestMaterializeIteratorErrorAbort(t *testing.T) {
43 ctx := context.TODO()

Callers

nothing calls this directly

Calls 5

newTestIteratorFunction · 0.85
NewMaterializeFunction · 0.85
NextMethod · 0.65
ErrorfMethod · 0.65
ErrMethod · 0.65

Tested by

no test coverage detected