| 186 | } |
| 187 | |
| 188 | func TestMarshalGolden(t *testing.T) { |
| 189 | for _, tt := range goldenMessages { |
| 190 | t.Run("", func(t *testing.T) { |
| 191 | if got, want := expandedMarshaler.Text(tt.m), tt.t; got != want { |
| 192 | t.Errorf("message %v: got:\n%s\nwant:\n%s", tt.m, got, want) |
| 193 | } |
| 194 | if got, want := expandedCompactMarshaler.Text(tt.m), tt.c; got != want { |
| 195 | t.Errorf("message %v: got:\n`%s`\nwant:\n`%s`", tt.m, got, want) |
| 196 | } |
| 197 | }) |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | func TestUnmarshalGolden(t *testing.T) { |
| 202 | for _, tt := range goldenMessages { |