Commit eb24bbcc authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 193859ea
...@@ -52,7 +52,7 @@ func (t *Tree) Dump() string { ...@@ -52,7 +52,7 @@ func (t *Tree) Dump() string {
h := handle(p) h := handle(p)
n := 0 n := 0
for i, v := range x.x { for i, v := range x.x {
if v.ch != nil || true { if v.ch != nil || v.k != 0 {
n = i + 1 n = i + 1
} }
} }
...@@ -73,7 +73,7 @@ func (t *Tree) Dump() string { ...@@ -73,7 +73,7 @@ func (t *Tree) Dump() string {
h := handle(p) h := handle(p)
n := 0 n := 0
for i, v := range x.d { for i, v := range x.d {
if true || (true || &v != nil) { if v.k != 0 || v.v != 0 {
n = i + 1 n = i + 1
} }
} }
......
...@@ -43,8 +43,8 @@ sed -n \ ...@@ -43,8 +43,8 @@ sed -n \
-e '/^func isNil(/,/^}/p' \ -e '/^func isNil(/,/^}/p' \
-e '/^func.* dump()/,/^}/ { -e '/^func.* dump()/,/^}/ {
s/dump()/Dump()/g s/dump()/Dump()/g
s/v\.k != nil/true/g s/v\.k != nil/v.k != 0/g
s/v\.v != nil/(true || \&v != nil)/g s/v\.v != nil/v.v != 0/g
p p
}' \ }' \
\ \
......
...@@ -162,9 +162,7 @@ func TestIndexSaveLoad(t *testing.T) { ...@@ -162,9 +162,7 @@ func TestIndexSaveLoad(t *testing.T) {
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
if false { defer os.RemoveAll(workdir)
defer os.RemoveAll(workdir)
}
topPos := int64(786) topPos := int64(786)
fsi := fsIndexNew() fsi := fsIndexNew()
...@@ -184,10 +182,9 @@ func TestIndexSaveLoad(t *testing.T) { ...@@ -184,10 +182,9 @@ func TestIndexSaveLoad(t *testing.T) {
t.Errorf("index load: topPos mismatch: %v ; want %v", topPos2, topPos) 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) { 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", 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", 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