diff options
Diffstat (limited to 'plumbing/format/index')
-rw-r--r-- | plumbing/format/index/decoder_test.go | 7 | ||||
-rw-r--r-- | plumbing/format/index/encoder_test.go | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/plumbing/format/index/decoder_test.go b/plumbing/format/index/decoder_test.go index fd83ffb..c3fa590 100644 --- a/plumbing/format/index/decoder_test.go +++ b/plumbing/format/index/decoder_test.go @@ -21,6 +21,7 @@ var _ = Suite(&IndexSuite{}) func (s *IndexSuite) TestDecode(c *C) { f, err := fixtures.Basic().One().DotGit().Open("index") c.Assert(err, IsNil) + defer func() { c.Assert(f.Close(), IsNil) }() idx := &Index{} d := NewDecoder(f) @@ -34,6 +35,7 @@ func (s *IndexSuite) TestDecode(c *C) { func (s *IndexSuite) TestDecodeEntries(c *C) { f, err := fixtures.Basic().One().DotGit().Open("index") c.Assert(err, IsNil) + defer func() { c.Assert(f.Close(), IsNil) }() idx := &Index{} d := NewDecoder(f) @@ -64,6 +66,7 @@ func (s *IndexSuite) TestDecodeEntries(c *C) { func (s *IndexSuite) TestDecodeCacheTree(c *C) { f, err := fixtures.Basic().One().DotGit().Open("index") c.Assert(err, IsNil) + defer func() { c.Assert(f.Close(), IsNil) }() idx := &Index{} d := NewDecoder(f) @@ -93,6 +96,7 @@ var expectedEntries = []TreeEntry{ func (s *IndexSuite) TestDecodeMergeConflict(c *C) { f, err := fixtures.Basic().ByTag("merge-conflict").One().DotGit().Open("index") c.Assert(err, IsNil) + defer func() { c.Assert(f.Close(), IsNil) }() idx := &Index{} d := NewDecoder(f) @@ -130,6 +134,7 @@ func (s *IndexSuite) TestDecodeMergeConflict(c *C) { func (s *IndexSuite) TestDecodeExtendedV3(c *C) { f, err := fixtures.Basic().ByTag("intent-to-add").One().DotGit().Open("index") c.Assert(err, IsNil) + defer func() { c.Assert(f.Close(), IsNil) }() idx := &Index{} d := NewDecoder(f) @@ -147,6 +152,7 @@ func (s *IndexSuite) TestDecodeExtendedV3(c *C) { func (s *IndexSuite) TestDecodeResolveUndo(c *C) { f, err := fixtures.Basic().ByTag("resolve-undo").One().DotGit().Open("index") c.Assert(err, IsNil) + defer func() { c.Assert(f.Close(), IsNil) }() idx := &Index{} d := NewDecoder(f) @@ -172,6 +178,7 @@ func (s *IndexSuite) TestDecodeResolveUndo(c *C) { func (s *IndexSuite) TestDecodeV4(c *C) { f, err := fixtures.Basic().ByTag("index-v4").One().DotGit().Open("index") c.Assert(err, IsNil) + defer func() { c.Assert(f.Close(), IsNil) }() idx := &Index{} d := NewDecoder(f) diff --git a/plumbing/format/index/encoder_test.go b/plumbing/format/index/encoder_test.go index bc5df0f..78cbbba 100644 --- a/plumbing/format/index/encoder_test.go +++ b/plumbing/format/index/encoder_test.go @@ -5,6 +5,7 @@ import ( "strings" "time" + "github.com/google/go-cmp/cmp" . "gopkg.in/check.v1" "gopkg.in/src-d/go-git.v4/plumbing" ) @@ -46,7 +47,7 @@ func (s *IndexSuite) TestEncode(c *C) { err = d.Decode(output) c.Assert(err, IsNil) - c.Assert(idx, DeepEquals, output) + c.Assert(cmp.Equal(idx, output), Equals, true) c.Assert(output.Entries[0].Name, Equals, strings.Repeat(" ", 20)) c.Assert(output.Entries[1].Name, Equals, "bar") |