|
|
@@ -453,8 +453,7 @@ var marshalingTests = []struct {
|
|
|
{"map<int64, string>", marshaler, &pb.Mappy{Buggy: map[int64]string{1234: "yup"}},
|
|
|
`{"buggy":{"1234":"yup"}}`},
|
|
|
{"map<bool, bool>", marshaler, &pb.Mappy{Booly: map[bool]bool{false: true}}, `{"booly":{"false":true}}`},
|
|
|
- // TODO: This is broken.
|
|
|
- //{"map<string, enum>", marshaler, &pb.Mappy{Enumy: map[string]pb.Numeral{"XIV": pb.Numeral_ROMAN}}, `{"enumy":{"XIV":"ROMAN"}`},
|
|
|
+ {"map<string, enum>", marshaler, &pb.Mappy{Enumy: map[string]pb.Numeral{"XIV": pb.Numeral_ROMAN}}, `{"enumy":{"XIV":"ROMAN"}}`},
|
|
|
{"map<string, enum as int>", Marshaler{EnumsAsInts: true}, &pb.Mappy{Enumy: map[string]pb.Numeral{"XIV": pb.Numeral_ROMAN}}, `{"enumy":{"XIV":2}}`},
|
|
|
{"map<int32, bool>", marshaler, &pb.Mappy{S32Booly: map[int32]bool{1: true, 3: false, 10: true, 12: false}}, `{"s32booly":{"1":true,"3":false,"10":true,"12":false}}`},
|
|
|
{"map<int64, bool>", marshaler, &pb.Mappy{S64Booly: map[int64]bool{1: true, 3: false, 10: true, 12: false}}, `{"s64booly":{"1":true,"3":false,"10":true,"12":false}}`},
|
|
|
@@ -748,8 +747,7 @@ var unmarshalingTests = []struct {
|
|
|
{"Any with message and indent", Unmarshaler{}, anySimplePrettyJSON, anySimple},
|
|
|
{"Any with WKT", Unmarshaler{}, anyWellKnownJSON, anyWellKnown},
|
|
|
{"Any with WKT and indent", Unmarshaler{}, anyWellKnownPrettyJSON, anyWellKnown},
|
|
|
- // TODO: This is broken.
|
|
|
- //{"map<string, enum>", Unmarshaler{}, `{"enumy":{"XIV":"ROMAN"}`, &pb.Mappy{Enumy: map[string]pb.Numeral{"XIV": pb.Numeral_ROMAN}}},
|
|
|
+ {"map<string, enum>", Unmarshaler{}, `{"enumy":{"XIV":"ROMAN"}}`, &pb.Mappy{Enumy: map[string]pb.Numeral{"XIV": pb.Numeral_ROMAN}}},
|
|
|
{"map<string, enum as int>", Unmarshaler{}, `{"enumy":{"XIV":2}}`, &pb.Mappy{Enumy: map[string]pb.Numeral{"XIV": pb.Numeral_ROMAN}}},
|
|
|
{"oneof", Unmarshaler{}, `{"salary":31000}`, &pb.MsgWithOneof{Union: &pb.MsgWithOneof_Salary{31000}}},
|
|
|
{"oneof spec name", Unmarshaler{}, `{"Country":"Australia"}`, &pb.MsgWithOneof{Union: &pb.MsgWithOneof_Country{"Australia"}}},
|
|
|
@@ -854,7 +852,7 @@ func TestUnmarshaling(t *testing.T) {
|
|
|
|
|
|
err := tt.unmarshaler.Unmarshal(strings.NewReader(tt.json), p)
|
|
|
if err != nil {
|
|
|
- t.Errorf("%s: %v", tt.desc, err)
|
|
|
+ t.Errorf("unmarshalling %s: %v", tt.desc, err)
|
|
|
continue
|
|
|
}
|
|
|
|