aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/config/decoder_test.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2017-07-27 17:17:34 +0200
committerSantiago M. Mola <santi@mola.io>2017-08-01 13:01:59 +0200
commite5c6fa237776870483cbe227d7f7ea943f35cb12 (patch)
treed8708626c6e4bdacdf3d3b796a17025908b6606b /plumbing/format/config/decoder_test.go
parent1e70916ca7e4d5c0ad00edbfd1877e06d7587fc6 (diff)
downloadgo-git-e5c6fa237776870483cbe227d7f7ea943f35cb12.tar.gz
config: preserve option order on config marshalling
Do not change order of options (e.g. in RemoteConfig) when serializing for any option whose value has not changed.
Diffstat (limited to 'plumbing/format/config/decoder_test.go')
-rw-r--r--plumbing/format/config/decoder_test.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/plumbing/format/config/decoder_test.go b/plumbing/format/config/decoder_test.go
index 412549f..0a8e92c 100644
--- a/plumbing/format/config/decoder_test.go
+++ b/plumbing/format/config/decoder_test.go
@@ -17,7 +17,10 @@ func (s *DecoderSuite) TestDecode(c *C) {
cfg := &Config{}
err := d.Decode(cfg)
c.Assert(err, IsNil, Commentf("decoder error for fixture: %d", idx))
- c.Assert(cfg, DeepEquals, fixture.Config, Commentf("bad result for fixture: %d", idx))
+ buf := bytes.NewBuffer(nil)
+ e := NewEncoder(buf)
+ _ = e.Encode(cfg)
+ c.Assert(cfg, DeepEquals, fixture.Config, Commentf("bad result for fixture: %d, %s", idx, buf.String()))
}
}