add no-catch option to test/run.bqn

This commit is contained in:
dzaima 2024-06-29 02:59:44 +03:00
parent 0319be27ea
commit d8a79145a6

View File

@ -11,6 +11,7 @@ Trim ← {((`⌾⌽∧∨`)𝕩≠' ')/𝕩}
•Out " noerr Disable erroring tests (ones expected to, or which contain ⎊)"
•Out " heapverify Disable tests that aren't runnable in heapverify"
•Out " debug Disable tests that aren't runnable in debug"
•Out " no-catch Disable catching errors in tests not expected to error"
•Out " update-messages Auto-update error messages in tests"
•Out " ignore-messages Don't warn about incorrect error messages"
•Out " bin-search Binary search for some property. Next argument should be /[01]*/, with a 1 appended every time the property is matched, and a 0 otherwise"
@ -35,7 +36,7 @@ o ← {
search search1
args (¬n𝕩)/args
}(´) "bin-search"¨ args
named "run""lint""update-messages""slow""ignore-messages""noerr""heapverify""debug"
named "run""lint""update-messages""slow""ignore-messages""noerr""heapverify""debug""no-catch"
i namedargs
run ´i=0
lint ´i=1
@ -45,11 +46,14 @@ o ← {
noerr ´i=5
heapverify ´i=6
debug ´i=7
noCatch ´i=8
noerr heapverify
files (i=named)/args
run update ¬´lintupdate
}
_catch_ {o.noCatch? 𝔽; 𝔽𝔾}
searchRefine {
searchI 0
{
@ -145,7 +149,7 @@ Run ← { 𝕊 testname:
results {
"eval"str: {
o.noerr? '⎊'str? skipped+1;
Eval{𝕊: Bad "Expected success, got error: "ErrMsg@} str
Eval _catch_ {𝕊: Bad "Expected success, got error: "ErrMsg@} str
@
};
"error"strexp: {
@ -162,7 +166,7 @@ Run ← { 𝕊 testname:
};
"equal"strexp: {
o.noerr? '⎊'str? skipped+1;
okgot (1Eval)(0ErrMsg) str
okgot (1Eval)_catch_(0ErrMsg) str
exp EvalS exp
{
¬ok? Bad "Expected value, but got error: "got;