aboutsummaryrefslogtreecommitdiffstats
path: root/tree_walker_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-08-30 11:29:47 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-08-30 11:29:47 +0200
commit2c527d02ceac3879f82ab53645b6c7c03c0e5d71 (patch)
treeebdd08843d1f5c6df7dff366ad5de8b4b2977e8c /tree_walker_test.go
parentd47285fa6e39399f639d8a9c3209d7d9bfb63ce4 (diff)
downloadgo-git-2c527d02ceac3879f82ab53645b6c7c03c0e5d71.tar.gz
TreeWalker optimization
Diffstat (limited to 'tree_walker_test.go')
-rw-r--r--tree_walker_test.go17
1 files changed, 11 insertions, 6 deletions
diff --git a/tree_walker_test.go b/tree_walker_test.go
index c03ddb2..fe6bcae 100644
--- a/tree_walker_test.go
+++ b/tree_walker_test.go
@@ -104,15 +104,20 @@ func (s *SuiteTreeWalker) TestNext(c *C) {
for k := 0; k < len(t.objs); k++ {
info := t.objs[k]
c.Assert(err, IsNil)
- name, entry, obj, err := walker.Next()
+ name, entry, err := walker.Next()
c.Assert(err, IsNil, Commentf("subtest %d, iter %d, err=%v", i, k, err))
- c.Assert(name, Equals, info.Name, Commentf("subtest %d, iter %d, name=%v, expected=%s, stack=%v, base=%v", i, k, name, info.Name, walker.stack, walker.base))
- c.Assert(obj.Type(), Equals, info.Kind, Commentf("subtest %d, iter %d, obj.Type()=%v expected=%v", i, k, obj.Type(), info.Kind))
- c.Assert(entry.Hash.String(), Equals, info.Hash, Commentf("subtest %d, iter %d, entry.Hash=%v, expected=%s", i, k, entry.Hash, info.Hash))
- c.Assert(obj.ID().String(), Equals, info.Hash, Commentf("subtest %d, iter %d, obj.ID()=%v, expected=%s", i, k, obj.ID(), info.Hash))
+ c.Assert(name, Equals, info.Name,
+ Commentf("subtest %d, iter %d, name=%v, expected=%s, stack=%v, base=%v", i, k, name, info.Name, walker.stack, walker.base))
+
+ c.Assert(entry.Hash.String(), Equals, info.Hash,
+ Commentf("subtest %d, iter %d, entry.Hash=%v, expected=%s", i, k, entry.Hash, info.Hash))
+
+ c.Assert(entry.Hash.String(), Equals, info.Hash,
+ Commentf("subtest %d, iter %d, obj.ID()=%v, expected=%s", i, k, entry.Hash.String(), info.Hash))
}
- _, _, _, err = walker.Next()
+
+ _, _, err = walker.Next()
c.Assert(err, Equals, io.EOF)
}
}