File: encoder_test.go

package info (click to toggle)
golang-github-go-git-go-git 5.4.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,072 kB
  • sloc: sh: 61; makefile: 29
file content (21 lines) | stat: -rw-r--r-- 451 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package config

import (
	"bytes"

	. "gopkg.in/check.v1"
)

type EncoderSuite struct{}

var _ = Suite(&EncoderSuite{})

func (s *EncoderSuite) TestEncode(c *C) {
	for idx, fixture := range fixtures {
		buf := &bytes.Buffer{}
		e := NewEncoder(buf)
		err := e.Encode(fixture.Config)
		c.Assert(err, IsNil, Commentf("encoder error for fixture: %d", idx))
		c.Assert(buf.String(), Equals, fixture.Text, Commentf("bad result for fixture: %d", idx))
	}
}