| 202 | } |
| 203 | |
| 204 | func TestBenchStrings(t *testing.T) { |
| 205 | bench := makeBench(1, 1) |
| 206 | s := bench.Report() |
| 207 | lines := strings.Split(s, "\n") |
| 208 | if len(lines) != 4 { |
| 209 | t.Fatal("Expected 3 lines of output: header, pub, sub, empty") |
| 210 | } |
| 211 | |
| 212 | bench = makeBench(2, 2) |
| 213 | s = bench.Report() |
| 214 | lines = strings.Split(s, "\n") |
| 215 | if len(lines) != 10 { |
| 216 | fmt.Printf("%q\n", s) |
| 217 | |
| 218 | t.Fatal("Expected 11 lines of output: header, pub header, pub x 2, stats, sub headers, sub x 2, stats, empty") |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | func TestMsgsPerClient(t *testing.T) { |
| 223 | zero := MsgsPerClient(0, 0) |