(t *testing.T)
| 95 | } |
| 96 | |
| 97 | func TestEncodeRequiredFieldChecks(t *testing.T) { |
| 98 | for _, test := range testValidMessages { |
| 99 | if !test.partial { |
| 100 | continue |
| 101 | } |
| 102 | for _, m := range test.decodeTo { |
| 103 | t.Run(fmt.Sprintf("%s (%T)", test.desc, m), func(t *testing.T) { |
| 104 | _, err := proto.Marshal(m) |
| 105 | if err == nil { |
| 106 | t.Fatalf("Marshal succeeded (want error)\nMessage:\n%v", prototext.Format(m)) |
| 107 | } |
| 108 | }) |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | func TestEncodeAppend(t *testing.T) { |
| 114 | want := []byte("prefix") |