diff --git a/test/README.md b/test/README.md index 0e8e83d8..aecdb6b4 100644 --- a/test/README.md +++ b/test/README.md @@ -13,8 +13,6 @@ test/run.bqn // run tests in test/cases/ ./BQN test/bit.bqn // fuzz-test •bit functions ./BQN test/mut.bqn // fuzz-test mut.h (currently just bitarr fill) ./BQN test/hash.bqn // fuzz-test hashing -./BQN test/squeezeValid.bqn // fuzz-test squeezing giving a correct result -./BQN test/squeezeExact.bqn // fuzz-test squeezing giving the exact smallest result ./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 diff --git a/test/squeezeExact.bqn b/test/cases/fuzz/squeezeExact.bqn similarity index 78% rename from test/squeezeExact.bqn rename to test/cases/fuzz/squeezeExact.bqn index 123616a8..46f497a9 100644 --- a/test/squeezeExact.bqn +++ b/test/cases/fuzz/squeezeExact.bqn @@ -1,7 +1,8 @@ -⟨EEqual, ClearRefs, Variation, Squeeze, Type⟩ ← •internal -u ← ⌊100×(•UnixTime+1|100וMonoTime)@ - -r ← •MakeRand •Show u +### WHOLE-FILE-TEST +# tests if squeeze produces the optimal result +helpers ← ⊑•args +r ← helpers.GetRand@ +⟨EEqual, ClearRefs, Variation, Unshare, Squeeze, Type⟩ ← •internal ntn ← "bit"‿"i8"‿"i16"‿"i32"‿"f64" ntv ← "Ab"‿"Ai8"‿"Ai16"‿"Ai32"‿"Af64" @@ -13,7 +14,7 @@ ctn ← "c8"‿"c16"‿"c32" ctv ← "Ac8"‿"Ac16"‿"Ac32" cmax ← 1114112⌊2⋆8×2⋆↕3 -⟨specF64⟩ ← ⟨r⟩ •Import "utils.bqn" +⟨specF64⟩ ← ⟨r⟩ helpers.Import "utils.bqn" spec ← specF64∾{⇐}∾"a⍉𝕨"∾(@+1114111-↕5)∾<"foo" RandEl ← r.Range∘3◶⟨ @@ -51,30 +52,24 @@ Do ← { 𝕊: { arrv ← 𝕩 Variation arr + arrv0 ← Unshare arrv sq ← Squeeze arrv sqt ← Type sq sqt↩{ "arr"≡¯3↑sqt? ¯3↓sqt; !"slice"≡¯5↑sqt ⋄ ¯5↓sqt } - ¬ (arrv EEqual arr) ∧ (arrv EEqual sq) ∧ (⊑(