1
1
mirror of https://github.com/wader/fq.git synced 2024-10-04 23:48:00 +03:00
fq/pkg/interp/assert.jq
2022-01-05 21:41:11 +01:00

12 lines
293 B
Plaintext

def log: if env.VERBOSE then printerrln else empty end;
def assert($name; $expected; $actual):
( if $expected == $actual then
"PASS \($name)" | log
else
( "FAIL \($name): expected \($expected) got \($actual)" | printerrln
, (null | halt_error(1))
)
end
);