1
1
mirror of https://github.com/wader/fq.git synced 2024-11-23 18:56:52 +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
);