(t *testing.T)
| 129 | } |
| 130 | |
| 131 | func TestNativeCodec(t *testing.T) { |
| 132 | nc, err := newNativeCodec() |
| 133 | if err != nil { |
| 134 | t.Fatal(err) |
| 135 | } |
| 136 | type S struct { |
| 137 | A int |
| 138 | } |
| 139 | want := S{3} |
| 140 | fields, err := nc.Encode(&want) |
| 141 | if err != nil { |
| 142 | t.Fatal(err) |
| 143 | } |
| 144 | var got S |
| 145 | if err := nc.Decode(fields, &got); err != nil { |
| 146 | t.Fatal(err) |
| 147 | } |
| 148 | if !cmp.Equal(got, want) { |
| 149 | t.Errorf("got %+v, want %+v", got, want) |
| 150 | } |
| 151 | } |
nothing calls this directly
no test coverage detected