Simplify Nexter interface
This change allows a Nexter to be used in the same manner as a scanner
using a for graph.Next(it) {} construction.
It is important that graph.Next(it) and any associated it.Result() calls
operate on the same iterator.
This commit is contained in:
parent
f8e28e066e
commit
b1a70d99aa
31 changed files with 168 additions and 233 deletions
|
|
@ -69,12 +69,8 @@ func TestValueComparison(t *testing.T) {
|
|||
vc := NewComparison(simpleFixedIterator(), test.operator, test.operand, ts)
|
||||
|
||||
var got []string
|
||||
for {
|
||||
val, ok := vc.Next()
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
got = append(got, ts.NameOf(val))
|
||||
for vc.Next() {
|
||||
got = append(got, ts.NameOf(vc.Result()))
|
||||
}
|
||||
if !reflect.DeepEqual(got, test.expect) {
|
||||
t.Errorf("Failed to show %s, got:%q expect:%q", test.message, got, test.expect)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue