nixite/testing/it.nix

17 lines
278 B
Nix
Raw Normal View History

2023-12-31 00:24:48 +00:00
msg: {
actual,
expected,
asString ? false,
2023-12-31 00:24:48 +00:00
}:
if (
if asString then toString actual == toString expected
else actual == expected )
2023-12-31 06:59:23 +00:00
then ''
echo 'it ${msg}'
''
else ''
echo 'FAILED: ${msg}'
echo '${builtins.toJSON expected}'
echo '${builtins.toJSON actual}'
''