diff options
author | Santiago M. Mola <santi@mola.io> | 2016-12-14 23:12:44 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-12-14 23:12:44 +0100 |
commit | 0af572dd21c0aa79d13745b633ee24ba6c4d6cf1 (patch) | |
tree | 49e81e74e82d84fd88b2fc1e4b0dc7c7bfe9c40f /utils/binary/writer_test.go | |
parent | df0f38af83f972f026d7e14150f3d37b95f13484 (diff) | |
download | go-git-0af572dd21c0aa79d13745b633ee24ba6c4d6cf1.tar.gz |
move plumbing from top level package to plumbing (#183)
* plumbing: rename Object -> EncodedObject.
* plumbing/storer: rename ObjectStorer -> EncodedObjectStorer.
* move difftree to plumbing/difftree.
* move diff -> utils/diff
* make Object/Tag/Blob/Tree/Commit/File depend on storer.
* Object and its implementations now depend only on
storer.EncodedObjectStorer, not git.Repository.
* Tests are decoupled accordingly.
* move Object/Commit/File/Tag/Tree to plumbing/object.
* move Object/Commit/File/Tag/Tree to plumbing/object.
* move checkClose to utils/ioutil.
* move RevListObjects to plumbing/revlist.Objects.
* move DiffTree to plumbing/difftree package.
* rename files with plural nouns to singular
* plumbing/object: add GetBlob/GetCommit/GetTag/GetTree.
Diffstat (limited to 'utils/binary/writer_test.go')
-rw-r--r-- | utils/binary/writer_test.go | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/utils/binary/writer_test.go b/utils/binary/writer_test.go deleted file mode 100644 index 1380280..0000000 --- a/utils/binary/writer_test.go +++ /dev/null @@ -1,59 +0,0 @@ -package binary - -import ( - "bytes" - "encoding/binary" - - . "gopkg.in/check.v1" -) - -func (s *BinarySuite) TestWrite(c *C) { - expected := bytes.NewBuffer(nil) - err := binary.Write(expected, binary.BigEndian, int64(42)) - c.Assert(err, IsNil) - err = binary.Write(expected, binary.BigEndian, int32(42)) - c.Assert(err, IsNil) - - buf := bytes.NewBuffer(nil) - err = Write(buf, int64(42), int32(42)) - c.Assert(err, IsNil) - c.Assert(buf, DeepEquals, expected) -} - -func (s *BinarySuite) TestWriteUint32(c *C) { - expected := bytes.NewBuffer(nil) - err := binary.Write(expected, binary.BigEndian, int32(42)) - c.Assert(err, IsNil) - - buf := bytes.NewBuffer(nil) - err = WriteUint32(buf, 42) - c.Assert(err, IsNil) - c.Assert(buf, DeepEquals, expected) -} - -func (s *BinarySuite) TestWriteUint16(c *C) { - expected := bytes.NewBuffer(nil) - err := binary.Write(expected, binary.BigEndian, int16(42)) - c.Assert(err, IsNil) - - buf := bytes.NewBuffer(nil) - err = WriteUint16(buf, 42) - c.Assert(err, IsNil) - c.Assert(buf, DeepEquals, expected) -} - -func (s *BinarySuite) TestWriteVariableWidthInt(c *C) { - buf := bytes.NewBuffer(nil) - - err := WriteVariableWidthInt(buf, 366) - c.Assert(err, IsNil) - c.Assert(buf.Bytes(), DeepEquals, []byte{129, 110}) -} - -func (s *BinarySuite) TestWriteVariableWidthIntShort(c *C) { - buf := bytes.NewBuffer(nil) - - err := WriteVariableWidthInt(buf, 19) - c.Assert(err, IsNil) - c.Assert(buf.Bytes(), DeepEquals, []byte{19}) -} |