Skip to content

Commit

Permalink
post-deletion test
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellm committed Jan 18, 2024
1 parent f983438 commit 72906be
Show file tree
Hide file tree
Showing 3 changed files with 4,773 additions and 6 deletions.
58 changes: 57 additions & 1 deletion compatibility_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ func TestCompatibility(t *testing.T) {

keyStrings = []string{
"1100000000000000000000000000000000000000000000000000000000010000",
"2211000000000000000000000000000000000000000000000000000000000000",
"3300000000000000000000000000000000000000000000000000000000000001",
"5500000000000000000000000000000000000000000000000000000000000000",
"5500000000000000000000000000000000000000000000000000000000001100",
}

Expand All @@ -159,4 +160,59 @@ func TestCompatibility(t *testing.T) {
panic(err)
}

//////////////////////////////////////////////////////////////////////////////

tree2 := New().(*InternalNode)

keyStrings = []string{
"0000000000000000000000000000000000000000000000000000000000000000",
"000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f",
"1100000000000000000000000000000000000000000000000000000000000000",
"2200000000000000000000000000000000000000000000000000000000000000",
"2211000000000000000000000000000000000000000000000000000000000000",
"3300000000000000000000000000000000000000000000000000000000000000",
"33000000000000000000000000000000000000000000000000000000000000ff",
"4400000000000000000000000000000000000000000000000000000000000000",
"4400000011000000000000000000000000000000000000000000000000000000",
"4400000011000000000000000000000000000000000000000000000000000001",
}

keys = nil
for _, s := range keyStrings {
k, _ := hex.DecodeString(s)
keys = append(keys, k)
}

valStrings = []string{
"0000000000000000000000000000000000000000000000000000000000000011",
"0000000000000000000000000000000000000000000000000000000000000002",
"0000000000000000000000000000000000000000000000000000000000000003",
"0000000000000000000000000000000000000000000000000000000000000004",
"0000000000000000000000000000000000000000000000000000000000000005",
"0000000000000000000000000000000000000000000000000000000000000006",
"0000000000000000000000000000000000000000000000000000000000000008",
"0000000000000000000000000000000000000000000000000000000000000009",
"000000000000000000000000000000000000000000000000000000000000000a",
"0000000000000000000000000000000000000000000000000000000000000013",
}

for i, s := range valStrings {
v, _ := hex.DecodeString(s)
tree2.Insert(keys[i], v, nil)
}

tree2.Commit()
bytes, _ = tree2.ToJSON()
text = string(bytes)

file, err = os.Create("testResults/compatibility4.new-tree.json")
if err != nil {
panic(err)
}
defer file.Close()
_, err = file.WriteString(string(text))
if err != nil {
panic(err)
}

}

0 comments on commit 72906be

Please sign in to comment.