Builds a rows x cols table where every cell holds a long sentence that won't fit on one line at any reasonably narrow column width, used by the word-wrap benchmarks below. Varying row/column content keeps every cell text distinct (closer to real data than repeating the same string).
| 253 | // word-wrap benchmarks below. Varying row/column content keeps every cell |
| 254 | // text distinct (closer to real data than repeating the same string). |
| 255 | Table make_long_text_table(int rows, int cols) { |
| 256 | Table table; |
| 257 | for (int r = 0; r < rows; ++r) { |
| 258 | Row_t row; |
| 259 | for (int c = 0; c < cols; ++c) |
| 260 | row.push_back("This is a much longer piece of cell content for row " + std::to_string(r) + |
| 261 | " column " + std::to_string(c) + |
| 262 | " that will not fit on one line and must be word-wrapped properly"); |
| 263 | table.add_row(row); |
| 264 | } |
| 265 | return table; |
| 266 | } |
| 267 | |
| 268 | // ============================================================================ |
| 269 | // 4a. Word-wrap scaling: for each rows x cols size, compare a table of short, |
no test coverage detected