(testingB *testing.B, nLines int)
| 130 | } |
| 131 | |
| 132 | func benchRead(testingB *testing.B, nLines int) { |
| 133 | rand.Seed(int64(nLines)) |
| 134 | |
| 135 | b := NewBufferFromString(randomText(nLines), "", BTDefault) |
| 136 | |
| 137 | testingB.ResetTimer() |
| 138 | |
| 139 | for i := 0; i < testingB.N; i++ { |
| 140 | b.Bytes() |
| 141 | for j := 0; j < b.LinesNum(); j++ { |
| 142 | b.Line(j) |
| 143 | b.LineBytes(j) |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | testingB.StopTimer() |
| 148 | |
| 149 | b.Close() |
| 150 | } |
| 151 | |
| 152 | func benchEdit(testingB *testing.B, nLines, nCursors int) { |
| 153 | rand.Seed(int64(nLines + nCursors)) |
no test coverage detected