jobjo / popper

Property-based testing at ease
ISC License
43 stars 1 forks source link

Write test summary at the bottom too #49

Closed bikallem closed 3 years ago

bikallem commented 3 years ago

At the moment the test summary is written at the very top. However, if there are a large number of tests, we have to scroll up the terminal screen to see the summary. For example when using tmux and dune runtest -w in one of the windows or just running dune runtest, the TUI screen real estate is quite small and one has to scroll up to see the test summary, e.g.

PASS: 178/178 tests passed in 0.00s.

It would enhance user experience if we print the same summary at the bottom as well so that one doesn't have to scroll up/down to view the test summary. So we would have the following,

PASS: 178/178 tests passed in 0.00s.

  ✓  String parsers -> String -> peek_char -> value is 'h'                       Passed  0ms
  ✓  String parsers -> String -> peek_char -> pos is 0                           Passed  0ms
... (lots of tests)
...
PASS: 178/178 tests passed in 0.00s.

Are you open to such functionality?

jobjo commented 3 years ago

I think that makes sense. Perhaps rephrasing slightly. How about something like the following?

178/178 tests passed in 0.00s:

  ✓  String parsers -> String -> peek_char -> value is 'h'                       Passed  0ms
  ✓  String parsers -> String -> peek_char -> pos is 0                           Passed  0ms
... (lots of tests)
...
Test Successful: Passed 178 tests in 0.00s.

Or, for error:

176/178 tests passed and 2 failed in  0.00s:

  ✓  String parsers -> String -> peek_char -> value is 'h'                       Passed  0ms
  ✓  String parsers -> String -> peek_char -> pos is 0                           Passed  0ms
... (lots of tests)
...
Test Failed: 176/178 tests passed and 2 failed in  0.00s.
bikallem commented 3 years ago

Yep. That’s even better.

jobjo commented 3 years ago

Fixed in https://github.com/jobjo/popper/pull/51