(t *testing.T)
| 199 | } |
| 200 | |
| 201 | func TestUnmarshalGolden(t *testing.T) { |
| 202 | for _, tt := range goldenMessages { |
| 203 | t.Run("", func(t *testing.T) { |
| 204 | want := tt.m |
| 205 | got := proto.Clone(tt.m) |
| 206 | got.Reset() |
| 207 | if err := proto.UnmarshalText(tt.t, got); err != nil { |
| 208 | t.Errorf("failed to unmarshal\n%s\nerror: %v", tt.t, err) |
| 209 | } |
| 210 | if !anyEqual(got, want) { |
| 211 | t.Errorf("message:\n%s\ngot:\n%s\nwant:\n%s", tt.t, got, want) |
| 212 | } |
| 213 | got.Reset() |
| 214 | if err := proto.UnmarshalText(tt.c, got); err != nil { |
| 215 | t.Errorf("failed to unmarshal\n%s\nerror: %v", tt.c, err) |
| 216 | } |
| 217 | if !anyEqual(got, want) { |
| 218 | t.Errorf("message:\n%s\ngot:\n%s\nwant:\n%s", tt.c, got, want) |
| 219 | } |
| 220 | }) |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | func TestMarshalUnknownAny(t *testing.T) { |
| 225 | m := &pb3.Message{ |
nothing calls this directly
no test coverage detected