aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/blob_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2018-10-15 12:21:23 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2018-10-15 12:21:23 +0200
commit7a77bde9448c15251cdcca14db20b7bf5c798692 (patch)
tree4fa875f1fa57b01dcdfdb17d1b3ba2d0519bd493 /plumbing/object/blob_test.go
parent0b7d3fe0a47bd7da9c42ba34b9098441120bda02 (diff)
parent345ffd95a2cd1413d7f48280e21a035febbe4e10 (diff)
downloadgo-git-7a77bde9448c15251cdcca14db20b7bf5c798692.tar.gz
Merge branch 'master' of github.com:src-d/go-git into annotated
Diffstat (limited to 'plumbing/object/blob_test.go')
-rw-r--r--plumbing/object/blob_test.go23
1 files changed, 21 insertions, 2 deletions
diff --git a/plumbing/object/blob_test.go b/plumbing/object/blob_test.go
index 5ed9de0..181436d 100644
--- a/plumbing/object/blob_test.go
+++ b/plumbing/object/blob_test.go
@@ -1,6 +1,7 @@
package object
import (
+ "bytes"
"io"
"io/ioutil"
@@ -88,8 +89,26 @@ func (s *BlobsSuite) TestBlobIter(c *C) {
}
c.Assert(err, IsNil)
- c.Assert(b, DeepEquals, blobs[i])
- i += 1
+ c.Assert(b.ID(), Equals, blobs[i].ID())
+ c.Assert(b.Size, Equals, blobs[i].Size)
+ c.Assert(b.Type(), Equals, blobs[i].Type())
+
+ r1, err := b.Reader()
+ c.Assert(err, IsNil)
+
+ b1, err := ioutil.ReadAll(r1)
+ c.Assert(err, IsNil)
+ c.Assert(r1.Close(), IsNil)
+
+ r2, err := blobs[i].Reader()
+ c.Assert(err, IsNil)
+
+ b2, err := ioutil.ReadAll(r2)
+ c.Assert(err, IsNil)
+ c.Assert(r2.Close(), IsNil)
+
+ c.Assert(bytes.Compare(b1, b2), Equals, 0)
+ i++
}
iter.Close()