Closed cospectrum closed 6 months ago
If that order was unexpected why not just fix that probably accidental mistake?
This is a common mistake, everyone will make it at some point. We can fix this once and for all.
Isn't it still useful to have a convention of argument order though? It makes reading the source code easier.
But you don't need a biased standard output for that, name a variable. And there are situations when there is no actual or expected result, you just want to compare.
Fair enough, I would still suggest fixing the wrongly ordered assert though for consistencies sake.
I prefer to have a consistent ordering of actual vs expected values in test definitions and error messages. I’ll leave this issue open until I’ve checked for other tests with back to front arguments in their assertions.
Currently, the first argument is named as
actual
and the second asexpected
. But even inimageproc
tests, someone has already messed up the order. For me, the standard output was very unexpected. Therefore, I suggest simply renaming the arguments toleft
andright
, similar to rust stdlib.