diff options
Diffstat (limited to 'utils/merkletrie/iter_test.go')
-rw-r--r-- | utils/merkletrie/iter_test.go | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/utils/merkletrie/iter_test.go b/utils/merkletrie/iter_test.go index 52d567a..fa7c5f5 100644 --- a/utils/merkletrie/iter_test.go +++ b/utils/merkletrie/iter_test.go @@ -4,7 +4,6 @@ import ( "fmt" "io" "strings" - "testing" "srcd.works/go-git.v4/utils/merkletrie" "srcd.works/go-git.v4/utils/merkletrie/internal/fsnoder" @@ -13,8 +12,6 @@ import ( . "gopkg.in/check.v1" ) -func Test(t *testing.T) { TestingT(t) } - type IterSuite struct{} var _ = Suite(&IterSuite{}) @@ -443,20 +440,13 @@ func find(c *C, tree noder.Noder, name string) noder.Path { } } -type errorNoder struct{} +type errorNoder struct{ noder.Noder } -func (e *errorNoder) Name() string { return "" } -func (e *errorNoder) String() string { return "" } -func (e *errorNoder) Hash() []byte { return nil } -func (e *errorNoder) IsDir() bool { return true } func (e *errorNoder) Children() ([]noder.Noder, error) { return nil, fmt.Errorf("mock error") } -func (e *errorNoder) NumChildren() (int, error) { - return 0, fmt.Errorf("mock error") -} func (s *IterSuite) TestNewIterFailsOnChildrenErrors(c *C) { _, err := merkletrie.NewIter(&errorNoder{}) - c.Assert(err, Not(IsNil)) + c.Assert(err, ErrorMatches, "mock error") } |