From 721a0e4a79d08be91277abcbf2f54cdec7254622 Mon Sep 17 00:00:00 2001 From: dzaima Date: Tue, 15 Nov 2022 16:44:33 +0200 Subject: [PATCH] update tests --- test/README.md | 10 ++++++---- test/cmp.bqn | 4 +++- test/ffi/test.bqn | 2 +- test/ffi/test.expected | 2 +- test/joinReuse.bqn | 4 +--- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/test/README.md b/test/README.md index 8eb0b1af..498fbfe9 100644 --- a/test/README.md +++ b/test/README.md @@ -9,13 +9,15 @@ test/moreCfgs.sh path/to/mlochbaum/BQN // run "2+2" in a bunch of configurations ./BQN test/cmp.bqn // fuzz-test scalar comparison functions =≠<≤>≥ ./BQN test/equal.bqn // fuzz-test 𝕨≡𝕩 ./BQN test/copy.bqn // fuzz-test creating new arrays with elements copied from another -./BQN test/bitcpy.bqn // fuzz-test bit_cpy; requires a CBQN build with -DTEST_BITCPY -./BQN test/mut.bqn // fuzz-test mut.h (currently just bitarr fill); requires a CBQN build with -DTEST_MUT +./BQN test/bitcpy.bqn // fuzz-test bit_cpy; requires -DTEST_BITCPY +./BQN test/bit.bqn // fuzz-test •bit functions +./BQN test/mut.bqn // fuzz-test mut.h (currently just bitarr fill); requires -DTEST_MUT ./BQN test/hash.bqn // fuzz-test hashing -./BQN test/squeezeValid.bqn // fuzz-test squeezing giving a correct result; requires a CBQN build with -DEEQUAL_NEGZERO -./BQN test/squeezeExact.bqn // fuzz-test squeezing giving the exact smallest result; requires a CBQN build with -DEEQUAL_NEGZERO +./BQN test/squeezeValid.bqn // fuzz-test squeezing giving a correct result; requires -DEEQUAL_NEGZERO +./BQN test/squeezeExact.bqn // fuzz-test squeezing giving the exact smallest result; requires -DEEQUAL_NEGZERO ./BQN test/various.bqn // tests for various small things ./BQN test/random.bqn // test (•MakeRand n).Range +./BQN test/joinReuse.bqn // test in-place join; requires -DPRINT_JOIN_REUSE make -C test/ffi // test FFI functionality; expects both regular and shared library CBQN builds to already exist legacy utilities: diff --git a/test/cmp.bqn b/test/cmp.bqn index 9446fb8f..bacb49c2 100644 --- a/test/cmp.bqn +++ b/test/cmp.bqn @@ -26,6 +26,7 @@ atms∾↩ @+⥊128‿65536+⌜2-↕5 LV ← •internal.ListVariations V ← •internal.Variation +C ← •internal.ClearRefs ElType ← •internal.ElType NEas ← ((⊑¨∊=‿≠˙) ∨ 8≠·ElType 2⊑¨⊢)⊸/ @@ -33,7 +34,7 @@ NEas ← ((⊑¨∊=‿≠˙) ∨ 8≠·ElType 2⊑¨⊢)⊸/ •Out "AS" { fn‿arr‿atm: - ∧´(⊏≡¨⊢) {(𝕩 V arr) Fn⎊"err" atm}¨ LV arr?0; + C@ ⋄ ∧´(⊏≡¨⊢) {(𝕩 V arr) Fn⎊"err" atm}¨ LV arr?0; fn‿arr‿atm: •Out "Fail:" •Show arr @@ -46,6 +47,7 @@ fn‿arr‿atm: •Out "AA" { fn‿l‿r: + C@ lr←(⌈´≠¨l‿r)↑¨l‿r ∧´(⊏≡¨⊢) {fn⎊"err"˝𝕩 V¨ lr}¨ ⥊≍○<⌜´ LV¨lr?0; 𝕩!0 diff --git a/test/ffi/test.bqn b/test/ffi/test.bqn index 4a139d68..4d32a7be 100644 --- a/test/ffi/test.bqn +++ b/test/ffi/test.bqn @@ -62,7 +62,7 @@ f ↩ "lib.so" •FFI ⟨"u64:i32","ident_u64",">u64" ⟩ ⋄ •Show F 12345 f ↩ "lib.so" •FFI ⟨"u64:u1", "ident_u64",">u64:c8" ⟩ ⋄ •Show F "hellowor" Section "# malloc test" -f ↩ "lib.so" •FFI "*:i32"‿"malloc"‿">u64" ⋄ •Show (•internal.Info⋈≠) malloc ← F 123 +f ↩ "lib.so" •FFI "*:i32"‿"malloc"‿">u64" ⋄ •Show (•internal.Type⋈≠) malloc ← F 123 f ↩ "lib.so" •FFI ""‿"free"‿">*:i32" ⋄ F malloc Section "# pick item" diff --git a/test/ffi/test.expected b/test/ffi/test.expected index 815949a5..a7535790 100644 --- a/test/ffi/test.expected +++ b/test/ffi/test.expected @@ -79,7 +79,7 @@ ff7fdfefefdf7bb4 ff7fdfefefdf7bb4 fefffdfff7ffbffb bffff7fffdfffeff ⟨ 0 0 0 1 0 1 1 0 1 0 1 0 0 1 1 0 0 0 1 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 0 0 1 0 0 1 1 1 0 ⟩ # malloc test -⟨ "fff7: refc:2 type:26=i32arr alloc:128" 2 ⟩ +⟨ "i32arr" 2 ⟩ # pick item "hellowor" diff --git a/test/joinReuse.bqn b/test/joinReuse.bqn index e0551083..1e7594d7 100644 --- a/test/joinReuse.bqn +++ b/test/joinReuse.bqn @@ -1,8 +1,6 @@ ⟨V⇐Variation ⋄ LV⇐ListVariations⟩←•internal AllEq ← !¨ (<∘⊑≡¨⊢) - -# run with -DPRINT_JOIN_REUSE -# all that's important in the output is that there are at least some "reuse:1"s and "reuse:0"s for each item +# all that's important in the output is that there are at least some "reuse:1"s and "reuse:0"s for each item; quoted errors the output are expected { w𝕊x: •Out "next"