(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestDecoder_Decode(t *testing.T) { |
| 11 | f, err := os.Open("testdata/user.pb") |
| 12 | if err != nil { |
| 13 | t.Fatal(err) |
| 14 | } |
| 15 | |
| 16 | d := newDecoder(f) |
| 17 | |
| 18 | var user testdata.User |
| 19 | err = d.Decode(&user) |
| 20 | if err != nil { |
| 21 | t.Fatal(err) |
| 22 | } |
| 23 | |
| 24 | if user.Name != "Tanguy" { |
| 25 | t.Fatal("could not decode name") |
| 26 | } |
| 27 | |
| 28 | if user.Id != 1 { |
| 29 | t.Fatal("could not decode ID") |
| 30 | } |
| 31 | } |
nothing calls this directly
no test coverage detected