UnkindPartition / tasty

Modern and extensible testing framework for Haskell
638 stars 108 forks source link

Make the output format slightly more configurable #366

Closed bfrk closed 1 year ago

bfrk commented 1 year ago

The tabular output format of the standard ConsoleTestReporter is certainly suitable in many, especially simple, cases. But the more tests you have, the higher the probability that some of them will have names that are much longer than the average one. If your test suite contains even a single test with a name that approaches or even exceeds the terminal width, then the tabular output format gets completely messed up! uses up two lines per test; I'd rather have it wrap around only when actually needed. By the same reasoning, the more tests you have the deeper the hierarchy tends to become, which, again, leads to problems with the tabular output, due to shifting things to the right. In such cases, it would be useful to have the option to disable tabular alignment and instead display the test result immediately after the test name.

Another feature I would like to configure is display of the time it took to run the test. Again, while certainly useful in some situations, there are other situations where this information is not needed and merely adds noise (and wastes horizontal space, adding to the problem mentioned above).

So I am proposing to add two more boolean valued options to the ConsoleTestReporter: one to control alignment and one to control reporting of run-times. I have looked at the code and I think this would be easy to implement and would not add more complexity than strictly necessary. I am willing to contribute code if you like the idea.

Bodigrim commented 1 year ago

This is a duplicate of #341 and #342, I believe, let's discuss it there.

I'm supportive of an option to suppress timings. Wrt alignment, I'd rather display the test result on the next line after additional indentation.

bfrk commented 1 year ago

Fine with me, closing as duplicate.