From 940a16ca68457beded1eff551f23febeffb32f3e Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Mon, 13 Feb 2017 19:18:05 +0100 Subject: format/index: sort the Entries before encode --- plumbing/format/index/encoder_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'plumbing/format/index/encoder_test.go') 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 @@ -23,6 +23,11 @@ func (s *IndexSuite) TestEncode(c *C) { Stage: TheirMode, Hash: plumbing.NewHash("e25b29c8946e0e192fae2edc1dabf7be71e8ecf3"), Name: "foo", + }, { + CreatedAt: time.Now(), + ModifiedAt: time.Now(), + Name: "bar", + Size: 82, }, { CreatedAt: time.Now(), ModifiedAt: time.Now(), @@ -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) { -- cgit