mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-25 16:05:27 +03:00
/lib/test: add +run-chain for test sequences
This commit is contained in:
parent
f2b85df948
commit
c48c2f4b6a
@ -40,6 +40,26 @@
|
||||
%| ~
|
||||
%& [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
|
||||
|
Loading…
Reference in New Issue
Block a user