Empty buf through repeated reads into fub. The initial contents of buf corresponds to the string s.
(t *testing.T, testname string, buf *Buffer, s string, fub []byte)
| 99 | // Empty buf through repeated reads into fub. |
| 100 | // The initial contents of buf corresponds to the string s. |
| 101 | func empty(t *testing.T, testname string, buf *Buffer, s string, fub []byte) { |
| 102 | check(t, testname+" (empty 1)", buf, s) |
| 103 | |
| 104 | for { |
| 105 | n, err := buf.Read(fub) |
| 106 | if n == 0 { |
| 107 | break |
| 108 | } |
| 109 | if err != nil { |
| 110 | t.Errorf(testname+" (empty 2): err should always be nil, found err == %s", err) |
| 111 | } |
| 112 | s = s[n:] |
| 113 | check(t, testname+" (empty 3)", buf, s) |
| 114 | } |
| 115 | |
| 116 | check(t, testname+" (empty 4)", buf, "") |
| 117 | } |
| 118 | |
| 119 | func TestBasicOperations(t *testing.T) { |
| 120 | var buf Buffer |
no test coverage detected