aboutsummaryrefslogtreecommitdiffstats
path: root/ptrie/iterator_test.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-11-21 01:11:31 +0800
committerobscuren <geffobscura@gmail.com>2014-11-21 01:11:31 +0800
commit12f1aea38d6f9dd9748a95b2d9ea813ae16277a7 (patch)
treebb979543f80229244e6d3ebf8ef9c21d7b6f1370 /ptrie/iterator_test.go
parentb05e63c34d335e65c8c76ed9a9401b74170db617 (diff)
downloadgo-tangerine-12f1aea38d6f9dd9748a95b2d9ea813ae16277a7.tar.gz
go-tangerine-12f1aea38d6f9dd9748a95b2d9ea813ae16277a7.tar.zst
go-tangerine-12f1aea38d6f9dd9748a95b2d9ea813ae16277a7.zip
Fixed iterator for short nodes.
In some cases the iterator didn't properly return the correct key because it didn't append fields to the reverse lookup.
Diffstat (limited to 'ptrie/iterator_test.go')
-rw-r--r--ptrie/iterator_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/ptrie/iterator_test.go b/ptrie/iterator_test.go
index 8921bb670..acfc03d63 100644
--- a/ptrie/iterator_test.go
+++ b/ptrie/iterator_test.go
@@ -8,12 +8,17 @@ func TestIterator(t *testing.T) {
{"do", "verb"},
{"ether", "wookiedoo"},
{"horse", "stallion"},
+ {"shaman", "horse"},
+ {"doge", "coin"},
+ {"dog", "puppy"},
+ {"somethingveryoddindeedthis is", "myothernodedata"},
}
v := make(map[string]bool)
for _, val := range vals {
v[val.k] = false
trie.UpdateString(val.k, val.v)
}
+ trie.Commit()
it := trie.Iterator()
for it.Next() {