diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-09-04 17:44:30 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-09-04 18:16:35 -0400 |
| commit | 9252f5cf71f1852b16cd7e2186ea4d41dffc5c2b (patch) | |
| tree | 552294d9cceec40e3988abc5f75ad6664ecc4d5d /test/fuzz.bqn | |
| parent | 18054b581d332cc9142cdd0ff1c9bec38d92aef5 (diff) | |
Turn enclosed atoms into atoms half the time for dyadic arithmetic
Diffstat (limited to 'test/fuzz.bqn')
| -rw-r--r-- | test/fuzz.bqn | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/fuzz.bqn b/test/fuzz.bqn index 986327e4..cb5265c9 100644 --- a/test/fuzz.bqn +++ b/test/fuzz.bqn @@ -120,8 +120,11 @@ gen ← { } _testConsistent_ ← {Match←𝔾 - v ← <˘⍉> (5⌊´≠¨)⊸(((0∾Rand⌾(-⟜1))⟜≠⊏⊢)¨) ListVariations¨ a←𝕨⋈𝕩 - (ClearRefs@) ⊢ (∧´ ⊏ Match¨ 1⊸↓) (𝕨 (𝔽⊑∘⊢)⊘(𝔽´⊢) Variation¨⟜a)¨ v + Arr ← 0=•Type + ListVar ← Arr◶(5⥊@)‿ListVariations + Var ← Arr∘⊢◶⊢‿Variation + v ← <˘⍉> (5⌊´≠¨)⊸(((0∾Rand⌾(-⟜1))⟜≠⊏⊢)¨) ListVar¨ a←𝕨⋈𝕩 + (ClearRefs@) ⊢ (∧´ ⊏ Match¨ 1⊸↓) (𝕨 (𝔽⊑∘⊢)⊘(𝔽´⊢) Var¨⟜a)¨ v } FlatMatch ← ≡◶⟨∧´∘⥊=∨∧○(≠˜),1⟩ @@ -138,11 +141,12 @@ _testDyArith ← {f←𝕗 ch ← 0<+´≠¨ pmn ← (∊⟜f⥊¨⊢) +‿-‿¬ { sh ← RandDyShape 𝕩 + Atom ← ⊑⍟(Rand∘2)⍟(⟨⟩≡≢) _t ← { ! 𝕏 _testConsistent_ FlatMatch´ 𝕗 } - (𝕨⊸gen.Arith¨ sh)_t¨ f + (Atom¨ 𝕨⊸gen.Arith¨ sh)_t¨ f { k←𝕩 - rca ← ⟨gen.Char,gen.Arith⟩{k𝕎𝕩}¨sh + rca ← Atom¨⟨gen.Char,gen.Arith⟩{k𝕎𝕩}¨sh Fit ← -⟜(@+1-˜17×2⋆16)⌈-⟜@⌊⊢ ⟨⌽⍟(Rand 2)-∘Fit⟜-`,Fit`,(1+Fit)`⟩ { (𝕎rca)_t 𝕩 }¨¨ pmn { (sh (k gen.Char ⊣)⌾(1⊸⊑) rca)_t¨ 𝕩 }⍟(0<≠) ∾1↓pmn |
