(t *testing.T)
| 832 | } |
| 833 | |
| 834 | func TestUnmarshaling(t *testing.T) { |
| 835 | for _, tt := range unmarshalingTests { |
| 836 | // Make a new instance of the type of our wanted object. |
| 837 | p := reflect.New(reflect.TypeOf(tt.pb).Elem()).Interface().(proto.Message) |
| 838 | |
| 839 | err := tt.unmarshaler.Unmarshal(strings.NewReader(tt.json), p) |
| 840 | if err != nil { |
| 841 | t.Errorf("unmarshaling %s: %v", tt.desc, err) |
| 842 | continue |
| 843 | } |
| 844 | |
| 845 | // For easier diffs, compare text strings of the protos. |
| 846 | exp := proto.MarshalTextString(tt.pb) |
| 847 | act := proto.MarshalTextString(p) |
| 848 | if string(exp) != string(act) { |
| 849 | t.Errorf("%s: got [%s] want [%s]", tt.desc, act, exp) |
| 850 | } |
| 851 | } |
| 852 | } |
| 853 | |
| 854 | func TestUnmarshalNullArray(t *testing.T) { |
| 855 | var repeats pb2.Repeats |
nothing calls this directly
no test coverage detected