returns nSection sections, each of them with nLines pkt-lines (not counting the flush-pkt: 0009 0.0\n 0009 0.1\n ... 0000 and so on
(c *C, nSections, nLines int)
| 221 | // 0000 |
| 222 | // and so on |
| 223 | func sectionsExample(c *C, nSections, nLines int) io.Reader { |
| 224 | var buf bytes.Buffer |
| 225 | e := pktline.NewEncoder(&buf) |
| 226 | |
| 227 | for section := 0; section < nSections; section++ { |
| 228 | ss := []string{} |
| 229 | for line := 0; line < nLines; line++ { |
| 230 | line := fmt.Sprintf(" %d.%d\n", section, line) |
| 231 | ss = append(ss, line) |
| 232 | } |
| 233 | err := e.EncodeString(ss...) |
| 234 | c.Assert(err, IsNil) |
| 235 | err = e.Flush() |
| 236 | c.Assert(err, IsNil) |
| 237 | } |
| 238 | |
| 239 | return &buf |
| 240 | } |
no test coverage detected
searching dependent graphs…