aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/trie_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'ethutil/trie_test.go')
-rw-r--r--ethutil/trie_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/ethutil/trie_test.go b/ethutil/trie_test.go
index 94414b82e..fa60c8cfc 100644
--- a/ethutil/trie_test.go
+++ b/ethutil/trie_test.go
@@ -45,6 +45,26 @@ func TestTrieSync(t *testing.T) {
}
}
+func TestTrieDirtyTracking(t *testing.T) {
+ _, trie := New()
+ trie.Update("dog", LONG_WORD)
+ if !trie.cache.IsDirty {
+ t.Error("Expected trie to be dirty")
+ }
+
+ trie.Sync()
+ if trie.cache.IsDirty {
+ t.Error("Expected trie not to be dirty")
+ }
+
+ trie.Update("test", LONG_WORD)
+ trie.cache.Undo()
+ if trie.cache.IsDirty {
+ t.Error("Expected trie not to be dirty")
+ }
+
+}
+
func TestTrieReset(t *testing.T) {
_, trie := New()