Commit eb24bbcc authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 193859ea
......@@ -52,7 +52,7 @@ func (t *Tree) Dump() string {
h := handle(p)
n := 0
for i, v := range x.x {
if v.ch != nil || true {
if v.ch != nil || v.k != 0 {
n = i + 1
}
}
......@@ -73,7 +73,7 @@ func (t *Tree) Dump() string {
h := handle(p)
n := 0
for i, v := range x.d {
if true || (true || &v != nil) {
if v.k != 0 || v.v != 0 {
n = i + 1
}
}
......
......@@ -43,8 +43,8 @@ sed -n \
-e '/^func isNil(/,/^}/p' \
-e '/^func.* dump()/,/^}/ {
s/dump()/Dump()/g
s/v\.k != nil/true/g
s/v\.v != nil/(true || \&v != nil)/g
s/v\.k != nil/v.k != 0/g
s/v\.v != nil/v.v != 0/g
p
}' \
\
......
......@@ -162,9 +162,7 @@ func TestIndexSaveLoad(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if false {
defer os.RemoveAll(workdir)
}
defer os.RemoveAll(workdir)
topPos := int64(786)
fsi := fsIndexNew()
......@@ -184,10 +182,9 @@ func TestIndexSaveLoad(t *testing.T) {
t.Errorf("index load: topPos mismatch: %v ; want %v", topPos2, topPos)
}
// XXX is it ok to compare trees via reflect.DeepEqual ?
if !treeEqual(fsi2.Tree, fsi.Tree) {
//t.Errorf("index load: trees mismatch:\nhave: %v\nwant: %v", fsi2.Tree.Dump(), fsi.Tree.Dump())
t.Errorf("index load: trees mismatch:\nhave: %v\nwant: %v", treeString(fsi2.Tree), treeString(fsi.Tree))
t.Errorf("index load: trees mismatch:\nhave: %v\nwant: %v", fsi2.Tree.Dump(), fsi.Tree.Dump())
//t.Errorf("index load: trees mismatch:\nhave: %v\nwant: %v", treeString(fsi2.Tree), treeString(fsi.Tree))
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment