/lib/test: add +run-chain for test sequences

This commit is contained in:
Ted Blackman 2022-08-19 02:37:33 +03:00
parent f2b85df948
commit c48c2f4b6a
2 changed files with 20 additions and 0 deletions

View File

@ -40,6 +40,26 @@
%| ~ %| ~
%& [leaf+"expected failure - succeeded" ~] %& [leaf+"expected failure - succeeded" ~]
== ==
:: $test-chain: a sequence of tests to be run
::
+$ test-chain
$_
|?
?: =(0 0)
[%& p=*tang]
[%| p=[tang=*tang next=^?(..$)]]
:: +run-chain: run a sequence of tests, stopping at first failure
::
++ run-chain
|= seq=test-chain
^- tang
=/ res $:seq
?- -.res
%& p.res
%| ?. =(~ tang.p.res)
tang.p.res
$(seq next.p.res)
==
:: +category: prepends a name to an error result; passes successes unchanged :: +category: prepends a name to an error result; passes successes unchanged
:: ::
++ category ++ category