(t *testing.T)
| 22 | } |
| 23 | |
| 24 | func TestWritesToString(t *testing.T) { |
| 25 | s := stringutil.NewString("") |
| 26 | |
| 27 | buf := []byte("Test") |
| 28 | |
| 29 | n, err := s.Write(buf) |
| 30 | if n != 4 || err != nil { |
| 31 | t.Fatalf("s.Read(buf) should have read the contents to the buffer") |
| 32 | } |
| 33 | |
| 34 | if s.String() != "Test" { |
| 35 | t.Errorf("s.Read(buf) should have read the contents to the buffer -> expected %q got %q", "Test", s.String()) |
| 36 | } |
| 37 | } |