- rename Reset() to Begin() in iterators (this will allow End() which will make reverse loops more readable)

This commit is contained in:
Emir Pasic
2016-06-27 00:08:01 +02:00
parent cbc23a5b79
commit 57162feff5
19 changed files with 70 additions and 60 deletions
+3 -3
View File
@@ -176,16 +176,16 @@ func TestStackIteratorPrev(t *testing.T) {
}
}
func TestStackIteratorReset(t *testing.T) {
func TestStackIteratorBegin(t *testing.T) {
stack := New()
it := stack.Iterator()
it.Reset()
it.Begin()
stack.Push("a")
stack.Push("b")
stack.Push("c")
for it.Next() {
}
it.Reset()
it.Begin()
it.Next()
if index, value := it.Index(), it.Value(); index != 0 || value != "c" {
t.Errorf("Got %v,%v expected %v,%v", index, value, 0, "c")