diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2017-02-13 19:18:05 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2017-02-13 19:18:05 +0100 |
commit | 940a16ca68457beded1eff551f23febeffb32f3e (patch) | |
tree | b914bf2ba817d9d6b614adc3ebb07ea04f41f906 /plumbing/format/index/encoder_test.go | |
parent | c551c29a93882658d4b34860b5300de0f3456059 (diff) | |
download | go-git-940a16ca68457beded1eff551f23febeffb32f3e.tar.gz |
format/index: sort the Entries before encode
Diffstat (limited to 'plumbing/format/index/encoder_test.go')
-rw-r--r-- | plumbing/format/index/encoder_test.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/plumbing/format/index/encoder_test.go b/plumbing/format/index/encoder_test.go index 914ee26..a6a0ea2 100644 --- a/plumbing/format/index/encoder_test.go +++ b/plumbing/format/index/encoder_test.go @@ -26,6 +26,11 @@ func (s *IndexSuite) TestEncode(c *C) { }, { CreatedAt: time.Now(), ModifiedAt: time.Now(), + Name: "bar", + Size: 82, + }, { + CreatedAt: time.Now(), + ModifiedAt: time.Now(), Name: strings.Repeat(" ", 20), Size: 82, }}, @@ -42,6 +47,11 @@ func (s *IndexSuite) TestEncode(c *C) { c.Assert(err, IsNil) c.Assert(idx, DeepEquals, output) + + c.Assert(output.Entries[0].Name, Equals, strings.Repeat(" ", 20)) + c.Assert(output.Entries[1].Name, Equals, "bar") + c.Assert(output.Entries[2].Name, Equals, "foo") + } func (s *IndexSuite) TestEncodeUnsuportedVersion(c *C) { |