add a way to allow ⎊-ful tests to run in noerr mode

This commit is contained in:
dzaima 2025-06-01 05:54:33 +03:00
parent 5d7caab374
commit c67afd6e52
2 changed files with 8 additions and 8 deletions

View File

@ -45,6 +45,7 @@ tests:
%SLOW # enable only if 'slow' argument present %SLOW # enable only if 'slow' argument present
%!DEBUG # disable if 'debug' argument present %!DEBUG # disable if 'debug' argument present
%!HEAPVERIFY # disable if 'heapverify' argument present %!HEAPVERIFY # disable if 'heapverify' argument present
%ALLOW_CATCH # allow running in noerr mode even if ⎊ is present
%!PROPER_FILLS # enable only if has PROPER_FILLS==0 %!PROPER_FILLS # enable only if has PROPER_FILLS==0
%PROPER_FILLS # enable only if has PROPER_FILLS==1 %PROPER_FILLS # enable only if has PROPER_FILLS==1
``` ```

View File

@ -124,6 +124,7 @@ Run ← { 𝕊 testname:
enabled {00: 1; 10: o.eachFills ; 01: ¬o.eachFills } Flag¨ "%EACH_FILLS""%!EACH_FILLS" enabled {00: 1; 10: o.eachFills ; 01: ¬o.eachFills } Flag¨ "%EACH_FILLS""%!EACH_FILLS"
enabled {00: 1; 10: o.usz=32; 01: o.usz=64} Flag¨ "%USZ32""%USZ64" enabled {00: 1; 10: o.usz=32; 01: o.usz=64} Flag¨ "%USZ32""%USZ64"
enabled {00: 1; 10: o.usz=32; 01: o.usz=64} Flag¨ "%USZ32""%EACHFILLS" enabled {00: 1; 10: o.usz=32; 01: o.usz=64} Flag¨ "%USZ32""%EACHFILLS"
enabled ¬ o.noerr ('⎊'str) ¬Flag "%ALLOW_CATCH"
ln i-1 ln i-1
str str # at end to let Flag have updated it str str # at end to let Flag have updated it
@ -157,7 +158,6 @@ Run ← { 𝕊 testname:
badCount 0 badCount 0
badMessage 0 badMessage 0
currLn 0 currLn 0
skipped 0
dir •file.At "testDir" dir •file.At "testDir"
•file.CreateDir(¬•file.Exists) dir •file.CreateDir(¬•file.Exists) dir
Bad { Bad {
@ -178,16 +178,16 @@ Run ← { 𝕊 testname:
dir, testname,"_line_",•Repr currLn+1,".bqn", helpers,"arg0",1 •BQN 𝕩 dir, testname,"_line_",•Repr currLn+1,".bqn", helpers,"arg0",1 •BQN 𝕩
} }
EvalS •BQN{𝕊: Bad "Computing expected value errored" "(could not compute expected value)"} EvalS •BQN{𝕊: Bad "Computing expected value errored" "(could not compute expected value)"}
toRun tests toRun tests
toRun {{𝕩.enabled}¨/𝕩} toRun {{𝕩.enabled}¨/𝕩}
skipped+ (tests)-toRun skipped (tests)-toRun
results { results {
"eval"str: { ns"eval"str: {
o.noerr? '⎊'str? skipped+1;
Eval _catch_ {𝕊: Bad "Expected success, got error: "ErrMsg@} str Eval _catch_ {𝕊: Bad "Expected success, got error: "ErrMsg@} str
@ @
}; };
"error"strexp: { ·"error"strexp: {
o.noerr? skipped+1; o.noerr? skipped+1;
okgot (1Eval)(0ErrMsg) str okgot (1Eval)(0ErrMsg) str
exp EvalS{×Trim𝕩} exp exp EvalS{×Trim𝕩} exp
@ -199,8 +199,7 @@ Run ← { 𝕊 testname:
got got
} }
}; };
"equal"strexp: { ns"equal"strexp: {
o.noerr? '⎊'str? skipped+1;
okgot (1Eval)_catch_(0ErrMsg) str okgot (1Eval)_catch_(0ErrMsg) str
exp EvalS exp exp EvalS exp
{ {
@ -211,7 +210,7 @@ Run ← { 𝕊 testname:
} }
@ @
} }
}{currLn(𝕩).ln 1𝕩}¨ toRun }{currLn(𝕩).ln 𝕩}¨ toRun
{𝕊: {𝕊:
resdesc ({@𝕩? 0; (¬(@+10)𝕩) ¬´"TEST FAIL"𝕩}¨ results)/¨ resultstoRun resdesc ({@𝕩? 0; (¬(@+10)𝕩) ¬´"TEST FAIL"𝕩}¨ results)/¨ resultstoRun