Fix Err fallout for graph/iterator.Comparison iterator

This commit is contained in:
Andrew Dunham 2015-04-14 17:21:12 -07:00
parent bb5fd55e21
commit 40cbbfcc1b
2 changed files with 23 additions and 0 deletions

View file

@ -15,6 +15,7 @@
package iterator
import (
"errors"
"reflect"
"testing"
@ -118,3 +119,17 @@ func TestVCIContains(t *testing.T) {
}
}
}
func TestComparisonIteratorErr(t *testing.T) {
retErr := errors.New("unique")
errIt := newTestIterator(false, retErr)
vc := NewComparison(errIt, compareLT, int64(2), simpleStore)
if vc.Next() != false {
t.Errorf("Comparison iterator did not pass through initial 'false'")
}
if vc.Err() != retErr {
t.Errorf("Comparison iterator did not pass through underlying Err")
}
}