(t *testing.T)
| 73 | } |
| 74 | |
| 75 | func TestLegacyUnmarshalMethod(t *testing.T) { |
| 76 | sm := &selfMarshaler{} |
| 77 | m := impl.Export{}.MessageOf(sm).Interface() |
| 78 | want := []byte("unmarshal") |
| 79 | if err := proto.Unmarshal(want, m); err != nil { |
| 80 | t.Fatalf("proto.Unmarshal(selfMarshaler{}) = %v, want nil", err) |
| 81 | } |
| 82 | if !bytes.Equal(sm.bytes, want) { |
| 83 | t.Fatalf("proto.Unmarshal(selfMarshaler{}): Marshal method not called") |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | type descPanicSelfMarshaler struct{} |
| 88 |