Commit 684afc1
Adjust newlines between the description and diff to improve matcher output consistency.
There are two slight inconsistencies that make output a little less consistent than ideal:
* When constructing the summarize_diff message, some branches return the empty string, another a string with a leading newline, and yet another a string without a leading newline.
* The explanation+diff formatting behavior between str_matcher and eq_matcher was not consistent: str_matcher added a newline between them, and eq_matcher did not, so depending on diff output, messages could be glued without a separator, making it harder to read.
We adjust the formatting code to try to improve consistency. We drop the leading newline from summarize_diff, and make it the responsibility of callers to conditionally add or omit newlines to separate (possibly empty) diff output from the leading description.
As a result, `eq_matcher` output aligns more closely with `str_matcher`.
PiperOrigin-RevId: 6969239301 parent 43a95ea commit 684afc1
File tree
4 files changed
+20
-8
lines changed- googletest/src
- matcher_support
- matchers
4 files changed
+20
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
473 | | - | |
474 | 473 | | |
475 | 474 | | |
476 | 475 | | |
| |||
494 | 493 | | |
495 | 494 | | |
496 | 495 | | |
497 | | - | |
498 | 496 | | |
499 | 497 | | |
500 | 498 | | |
| |||
514 | 512 | | |
515 | 513 | | |
516 | 514 | | |
517 | | - | |
518 | 515 | | |
519 | 516 | | |
520 | 517 | | |
| |||
546 | 543 | | |
547 | 544 | | |
548 | 545 | | |
549 | | - | |
550 | 546 | | |
551 | 547 | | |
552 | 548 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
120 | 124 | | |
121 | 125 | | |
122 | 126 | | |
| |||
176 | 180 | | |
177 | 181 | | |
178 | 182 | | |
| 183 | + | |
179 | 184 | | |
180 | 185 | | |
181 | 186 | | |
| |||
198 | 203 | | |
199 | 204 | | |
200 | 205 | | |
| 206 | + | |
201 | 207 | | |
202 | 208 | | |
203 | 209 | | |
| |||
220 | 226 | | |
221 | 227 | | |
222 | 228 | | |
| 229 | + | |
223 | 230 | | |
224 | 231 | | |
225 | 232 | | |
| |||
241 | 248 | | |
242 | 249 | | |
243 | 250 | | |
| 251 | + | |
244 | 252 | | |
245 | 253 | | |
246 | 254 | | |
| |||
265 | 273 | | |
266 | 274 | | |
267 | 275 | | |
| 276 | + | |
268 | 277 | | |
269 | 278 | | |
270 | 279 | | |
| |||
289 | 298 | | |
290 | 299 | | |
291 | 300 | | |
| 301 | + | |
292 | 302 | | |
293 | 303 | | |
294 | 304 | | |
| |||
310 | 320 | | |
311 | 321 | | |
312 | 322 | | |
| 323 | + | |
313 | 324 | | |
314 | 325 | | |
315 | 326 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
536 | | - | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
537 | 541 | | |
538 | 542 | | |
539 | 543 | | |
| |||
0 commit comments