(c *C)
| 12 | var _ = Suite(&DecoderSuite{}) |
| 13 | |
| 14 | func (s *DecoderSuite) TestDecode(c *C) { |
| 15 | for idx, fixture := range fixtures { |
| 16 | r := bytes.NewReader([]byte(fixture.Raw)) |
| 17 | d := NewDecoder(r) |
| 18 | cfg := &Config{} |
| 19 | err := d.Decode(cfg) |
| 20 | c.Assert(err, IsNil, Commentf("decoder error for fixture: %d", idx)) |
| 21 | buf := bytes.NewBuffer(nil) |
| 22 | e := NewEncoder(buf) |
| 23 | _ = e.Encode(cfg) |
| 24 | c.Assert(cfg, DeepEquals, fixture.Config, Commentf("bad result for fixture: %d, %s", idx, buf.String())) |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | func (s *DecoderSuite) TestDecodeFailsWithIdentBeforeSection(c *C) { |
| 29 | t := ` |
nothing calls this directly
no test coverage detected