dtr-org / unit-e

A digital currency for a new era of decentralized trust
https://unit-e.io
MIT License
45 stars 15 forks source link

Show failing unit tests at the bottom in run-unit-tests.sh #1024

Closed cmihai closed 5 years ago

cmihai commented 5 years ago

This commit modifies the sort order for the results of run-unit-tests.sh.

Previously, they were sorted lexicographically, which meant that the failing tests showed on top and could potentially disappear off-screen. Now, the test results are sorted first by name (from character 6 to the end of the line), then by status (characters 3 to 5) in reverse order.

Tested on Linux, however, according to the manpage, the same options should work on MacOS as well.

scravy commented 5 years ago

Concept ACK

One question about the fancy sort call:

$ cat > test
[x] ka
[x] gb
[ ] sc
[x] ad
$ cat test | sort -t / -k 1.6 | sort -s -t / -k 1.3,1.5 -r
[ ] sc
[x] ka
[x] gb
[x] ad

should this not be the other way around?

(I was checking to see whether GNU sort and BSD sort do the same things, checked on macOS / BSD sort)

cmihai commented 5 years ago

@scravy In the run-unit-tests output, there's also a dash at the beginning, so the sort takes characters 3 to 5 as the sort key (instead of 1 to 3).

scravy commented 5 years ago

I see! My bad 🤗

scravy commented 5 years ago

ACK eb088f0