aboutsummaryrefslogtreecommitdiffstats
path: root/utils/merkletrie/change_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'utils/merkletrie/change_test.go')
-rw-r--r--utils/merkletrie/change_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/utils/merkletrie/change_test.go b/utils/merkletrie/change_test.go
index f73eb86..cd28bfe 100644
--- a/utils/merkletrie/change_test.go
+++ b/utils/merkletrie/change_test.go
@@ -28,6 +28,17 @@ func (s *ChangeSuite) TestUnsupportedAction(c *C) {
c.Assert(a.String, PanicMatches, "unsupported action.*")
}
+func (s ChangeSuite) TestEmptyChanges(c *C) {
+ ret := merkletrie.NewChanges()
+ p := noder.Path{}
+
+ err := ret.AddRecursiveInsert(p)
+ c.Assert(err, Equals, merkletrie.ErrEmptyFileName)
+
+ err = ret.AddRecursiveDelete(p)
+ c.Assert(err, Equals, merkletrie.ErrEmptyFileName)
+}
+
func (s ChangeSuite) TestNewInsert(c *C) {
tree, err := fsnoder.New("(a(b(z<>)))")
c.Assert(err, IsNil)