From b30b9ab8cb13ddbc68a4912c9f06116c0f59bc27 Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 25 Feb 2014 10:50:53 +0100 Subject: Fixed a minor issue where a string is expected but returns slice --- ethutil/trie_test.go | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'ethutil/trie_test.go') diff --git a/ethutil/trie_test.go b/ethutil/trie_test.go index c3a8f224d..645c5a225 100644 --- a/ethutil/trie_test.go +++ b/ethutil/trie_test.go @@ -1,7 +1,6 @@ package ethutil import ( - "fmt" "reflect" "testing" ) @@ -160,15 +159,13 @@ func TestTrieIterator(t *testing.T) { trie.Update("ca", LONG_WORD) trie.Update("cat", LONG_WORD) + lenBefore := len(trie.cache.nodes) it := trie.NewIterator() - fmt.Println("purging") - fmt.Println("len =", it.Purge()) - /* - for it.Next() { - k := it.Key() - v := it.Value() - - fmt.Println(k, v) - } - */ + if num := it.Purge(); num != 3 { + t.Errorf("Expected purge to return 3, got %d", num) + } + + if lenBefore == len(trie.cache.nodes) { + t.Errorf("Expected cached nodes to be deleted") + } } -- cgit