(t *testing.T)
| 586 | } |
| 587 | |
| 588 | func TestMarshalTextFailing(t *testing.T) { |
| 589 | // Try lots of different sizes to exercise more error code-paths. |
| 590 | for lim := 0; lim < len(text); lim++ { |
| 591 | buf := new(limitedWriter) |
| 592 | buf.limit = lim |
| 593 | err := proto.MarshalText(buf, newTestMessage()) |
| 594 | // We expect a certain error, but also some partial results in the buffer. |
| 595 | if err != outOfSpace { |
| 596 | t.Errorf("error mismatch: got %v, want %v", err, outOfSpace) |
| 597 | } |
| 598 | got := buf.b.String() |
| 599 | want := text[:buf.limit] |
| 600 | if got != want { |
| 601 | t.Errorf("text mismatch:\n\ngot:\n%v\n\nwant:\n%v", got, want) |
| 602 | } |
| 603 | } |
| 604 | } |
| 605 | |
| 606 | func TestFloats(t *testing.T) { |
| 607 | tests := []struct { |
nothing calls this directly
no test coverage detected