diff --git a/test/README.md b/test/README.md index c9f7136c..1d727dca 100644 --- a/test/README.md +++ b/test/README.md @@ -7,7 +7,6 @@ test/mainCfgs.sh path/to/mlochbaum/BQN // run the test suite for a couple primar test/x86Cfgs.sh path/to/mlochbaum/BQN // run the test suite for x86-64-specific configurations, including singeli; 32-bit build is "supposed" to fail one test involving ⋆⁼ test/moreCfgs.sh path/to/mlochbaum/BQN // run "2+2" in a bunch of configurations; requires dzaima/BQN to be accessible as dbqn test/run.bqn // run tests in test/cases/ -./BQN test/cmp.bqn // fuzz-test scalar comparison functions =≠<≤>≥ ./BQN test/copy.bqn // fuzz-test creating new arrays with elements copied from another ./BQN test/mut.bqn // fuzz-test mut.h (currently just bitarr fill) ./BQN test/various.bqn // tests for various small things diff --git a/test/cmp.bqn b/test/cases/fuzz/cmp.bqn similarity index 90% rename from test/cmp.bqn rename to test/cases/fuzz/cmp.bqn index bacb49c2..e9ffefdc 100644 --- a/test/cmp.bqn +++ b/test/cases/fuzz/cmp.bqn @@ -1,5 +1,7 @@ -noerr←≠•args -•Out⍟noerr "Not executing tests that would error" +### WHOLE-FILE-TEST +# tests scalar comparison functions =≠<≤>≥ +helpers ← ⊑•args +noerr ← helpers.shouldNotError # %ALLOW_CATCH fns ← =‿≠‿<‿≤‿>‿≥ n ← 0÷0 nn ← -n @@ -31,7 +33,7 @@ ElType ← •internal.ElType NEas ← ((⊑¨∊=‿≠˙) ∨ 8≠·ElType 2⊑¨⊢)⊸/ -•Out "AS" +# •Out "AS" { fn‿arr‿atm: C@ ⋄ ∧´(⊏≡¨⊢) {(𝕩 V arr) Fn⎊"err" atm}¨ LV arr?0; @@ -41,10 +43,10 @@ fn‿arr‿atm: •Show fn •Show atm •Show ⍉(LV arr)≍{(𝕩 V arr) Fn⎊"err" atm}¨ LV arr - •Exit 1 + ! 0 }¨ NEas⍟noerr ⥊(<⟨⟩)<⊸∾⌜´ fns‿arrs‿atms -•Out "AA" +# •Out "AA" { fn‿l‿r: C@ diff --git a/test/run.bqn b/test/run.bqn index 46433a7b..a3b8ecf1 100644 --- a/test/run.bqn +++ b/test/run.bqn @@ -250,6 +250,8 @@ helpers ← { w F _𝕣_ LV x: (CLR@) ⊢ (LV 𝕨) {(𝕨 TV w) F 𝕩 TV x}⌜ LV 𝕩 } + shouldNotError ⇐ o.noerr + {o.heapverify? Indistinguishable↩EEqual; @} Classify ← {(≢𝕩)⥊ ⊐Indistinguishable⌜˜ ⥊𝕩}