Enumerate iterator types

This commit is contained in:
kortschak 2014-07-03 09:57:31 +09:30
parent 1f67913ed9
commit cd46452b63
23 changed files with 145 additions and 68 deletions

View file

@ -21,6 +21,8 @@ import (
"reflect"
"sort"
"testing"
"github.com/google/cayley/graph"
)
func TestIteratorPromotion(t *testing.T) {
@ -37,7 +39,7 @@ func TestIteratorPromotion(t *testing.T) {
if !changed {
t.Error("Iterator didn't optimize")
}
if newIt.Type() != "fixed" {
if newIt.Type() != graph.Fixed {
t.Error("Expected fixed iterator")
}
tagsExpected := []string{"a", "b", "c"}
@ -58,7 +60,7 @@ func TestNullIteratorAnd(t *testing.T) {
if !changed {
t.Error("Didn't change")
}
if newIt.Type() != "null" {
if newIt.Type() != graph.Null {
t.Error("Expected null iterator, got ", newIt.Type())
}
}