mirror of
https://github.com/catchorg/Catch2.git
synced 2026-07-06 08:30:47 +02:00
bd2d918f32
Passing the CLI argument '--list-tags' outputs a list like:
```
All available tags:
11 [mytag]
4 [myothertag]
2 tags
```
However, the width of the tag-count column was previously hardcoded to 2, such that the formatting broke (with the tag names awkwardly misaligned/displaced) for 3+ digit tag counts. This occurred whenever a tag contains one hundred or more tests, and would result in formatting like:
```
All available tags:
11 [mytag]
100 [myjumbotag]
4 [myothertag]
3 tags
```
This patch pre-computes the maximum number of digits among the tag counts, expanding the padding when there are more than 100 tests in a tag (and handling when tags are empty). It now outputs e.g.
```
All available tags:
11 [mytag]
100 [myjumbotag]
4 [myothertag]
3 tags
```