Simple tests for bytes
(t *testing.T)
| 321 | |
| 322 | // Simple tests for bytes |
| 323 | func TestBytesPrimitives(t *testing.T) { |
| 324 | bb := new(proto.Buffer) |
| 325 | want := []byte("now is the time") |
| 326 | if err := bb.EncodeRawBytes(want); err != nil { |
| 327 | t.Errorf("EncodeRawBytes error: %v", err) |
| 328 | } |
| 329 | got, err := bb.DecodeRawBytes(false) |
| 330 | if err != nil { |
| 331 | t.Errorf("DecodeRawBytes error: %v", err) |
| 332 | } |
| 333 | if !bytes.Equal(got, want) { |
| 334 | t.Errorf("got %q\nwant %q", got, want) |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | // Simple tests for strings |
| 339 | func TestStringPrimitives(t *testing.T) { |
nothing calls this directly
no test coverage detected