发现已经做了位置处理, 不需要再去改名

This commit is contained in:
2019-07-22 02:02:05 +08:00
parent 9263c03525
commit 76f81b9920
18 changed files with 272 additions and 167 deletions

View File

@@ -151,7 +151,29 @@ func TestTreeSet_Iterator(t *testing.T) {
set.Add(5, 4, 3, 5)
iter := set.Iterator()
for iter.Prev() {
iter.ToHead()
// 3 4 5
if iter.Value() != 3 {
t.Error(iter.Value())
}
iter.Next()
if iter.Value() != 4 {
t.Error(iter.Value())
}
iter.Next()
if iter.Value() != 5 {
t.Error(iter.Value())
}
iter.ToTail()
if iter.Value() != 5 {
t.Error(iter.Value())
}
iter.Prev()
if iter.Value() != 4 {
t.Error(iter.Value())
}
}