nixite/testing/it.nix

17 lines
278 B
Nix

msg: {
actual,
expected,
asString ? false,
}:
if (
if asString then toString actual == toString expected
else actual == expected )
then ''
echo 'it ${msg}'
''
else ''
echo 'FAILED: ${msg}'
echo '${builtins.toJSON expected}'
echo '${builtins.toJSON actual}'
''