mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
26 lines
339 B
Go
26 lines
339 B
Go
package toml
|
|
|
|
import (
|
|
"bytes"
|
|
"testing"
|
|
)
|
|
|
|
type encodeSimple struct {
|
|
Location string
|
|
// Ages []int
|
|
// DOB time.Time
|
|
}
|
|
|
|
func TestEncode(t *testing.T) {
|
|
v := encodeSimple{
|
|
Location: "Westborough, MA",
|
|
}
|
|
|
|
buf := new(bytes.Buffer)
|
|
e := newEncoder(buf)
|
|
if err := e.Encode(v); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
testf(buf.String())
|
|
}
|