Test for errors in .Contains() and .NextPath()
This commit is contained in:
parent
7de923d40a
commit
430ff507f0
8 changed files with 71 additions and 11 deletions
|
|
@ -155,6 +155,7 @@ func (it *Comparison) NextPath() bool {
|
|||
for {
|
||||
hasNext := it.subIt.NextPath()
|
||||
if !hasNext {
|
||||
it.err = it.subIt.Err()
|
||||
return false
|
||||
}
|
||||
if it.doComparison(it.subIt.Result()) {
|
||||
|
|
@ -174,7 +175,11 @@ func (it *Comparison) Contains(val graph.Value) bool {
|
|||
if !it.doComparison(val) {
|
||||
return false
|
||||
}
|
||||
return it.subIt.Contains(val)
|
||||
ret := it.subIt.Contains(val)
|
||||
if !ret {
|
||||
it.err = it.subIt.Err()
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
// If we failed the check, then the subiterator should not contribute to the result
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue