Skip to content

Commit

Permalink
Add one more test case for test depth
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Feb 21, 2022
1 parent 0b114f1 commit b7ac980
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions lib/trie/trie_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3430,6 +3430,32 @@ func Test_Trie_delete(t *testing.T) {
updated: true,
nodesRemoved: 2,
},
"delete branch and keep two children": {
trie: Trie{
generation: 1,
},
parent: &node.Branch{
Key: []byte{1},
Value: []byte{1},
Stats: node.NewStats(2),
Children: [16]node.Node{
&node.Leaf{Key: []byte{2}},
&node.Leaf{Key: []byte{2}},
},
},
key: []byte{1},
newParent: &node.Branch{
Key: []byte{1},
Generation: 1,
Dirty: true,
Stats: node.NewStats(2),
Children: [16]node.Node{
&node.Leaf{Key: []byte{2}},
&node.Leaf{Key: []byte{2}},
},
},
updated: true,
},
}

for name, testCase := range testCases {
Expand Down

0 comments on commit b7ac980

Please sign in to comment.