File: marshal_test.go

package info (click to toggle)
golang-github-nicksnyder-go-i18n.v2 2.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 464 kB
  • sloc: xml: 198; sh: 5; makefile: 3
file content (21 lines) | stat: -rw-r--r-- 320 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package main

import "testing"

func TestMarshal(t *testing.T) {
	actual, err := marshal(map[string]string{
		"&<key>": "&<val>",
	}, "json")

	if err != nil {
		t.Fatal(err)
	}

	expected := `{
  "&<key>": "&<val>"
}
`
	if a := string(actual); a != expected {
		t.Fatalf("\nexpected:\n%s\n\ngot\n%s", expected, a)
	}
}