1
1
mirror of https://github.com/wader/fq.git synced 2024-11-27 14:14:58 +03:00
fq/pkg/interp/assert.jq

14 lines
314 B
Plaintext
Raw Normal View History

include "internal";
def log: if env.VERBOSE then printerrln else empty end;
2021-08-21 19:52:29 +03:00
2021-08-14 20:50:17 +03:00
def assert($name; $expected; $actual):
( if $expected == $actual then
"PASS \($name)" | log
2020-06-08 03:29:51 +03:00
else
( "FAIL \($name): expected \($expected) got \($actual)" | printerrln
2020-06-08 03:29:51 +03:00
, (null | halt_error(1))
)
end
);