diff options
Diffstat (limited to 'walk/walk_test.go')
-rw-r--r-- | walk/walk_test.go | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/walk/walk_test.go b/walk/walk_test.go deleted file mode 100644 index 759c501..0000000 --- a/walk/walk_test.go +++ /dev/null @@ -1,45 +0,0 @@ -package walk - -import ( - "testing" - "log" -) - -func TestValueIter(t *testing.T) { - values := ValueList{ - NumberValue(1), - NumberValue(2), - NumberValue(3), - } - - valuesCopy := ValueList{} - - iter := NewValueIter(values) - - for { - edible := iter.Next() - if edible == nil { - break - } - - log.Println(edible) - - value, isValue := edible.(Value) - - if !isValue { - t.Fatalf("Iterator produced a non-value") - } - - valuesCopy = append(valuesCopy, value) - } - - if len(values) != len(valuesCopy) { - t.Fatalf("iter gave the wrong number of values") - } - - for i, value := range values { - if value != valuesCopy[i] { - t.Fatalf("iter produced an incorrect value") - } - } -} |