debian/go/src/github.com/gohugoio/go-i18n/v2/goi18n/marshal_test.go
raw| 1 | package main |
| 2 | |
| 3 | import "testing" |
| 4 | |
| 5 | func TestMarshal(t *testing.T) { |
| 6 | actual, err := marshal(map[string]string{ |
| 7 | "&<key>": "&<val>", |
| 8 | }, "json") |
| 9 | |
| 10 | if err != nil { |
| 11 | t.Fatal(err) |
| 12 | } |
| 13 | |
| 14 | expected := `{ |
| 15 | "&<key>": "&<val>" |
| 16 | } |
| 17 | ` |
| 18 | if a := string(actual); a != expected { |
| 19 | t.Fatalf("\nexpected:\n%s\n\ngot\n%s", expected, a) |
| 20 | } |
| 21 | } |