diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-06-03 14:48:13 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-06-03 14:48:13 -0400 |
| commit | 3de861c5622393e373541015352d5f8d2fc20ea1 (patch) | |
| tree | 6d60090230ca1ff2af5064402b2126d1b18b46f3 /test | |
| parent | 6baa93f7fe80a402483f054139dcb88bf7076e62 (diff) | |
Prevent character arithmetic tests from going out of range and enable them
Diffstat (limited to 'test')
| -rw-r--r-- | test/fuzz.bqn | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/test/fuzz.bqn b/test/fuzz.bqn index 274b70e4..9c52f9d7 100644 --- a/test/fuzz.bqn +++ b/test/fuzz.bqn @@ -134,13 +134,17 @@ RandDyShape ← { } TestDyArith ← opts.dyArith{ (0<≠f←𝕗) ⊑ 1‿{ - k ← 𝕨 ⋄ sh ← RandDyShape 𝕩 + sh ← RandDyShape 𝕩 _t ← { ! 𝕏 _testConsistent_ FlatMatch´ 𝕗 } (𝕨⊸RandArith¨ sh)_t¨ f - p‿m ← (∊/⊣)⟜f¨ ⟨+⟩‿⟨-⟩ - rca ← ⟨RandChar,RandArith⟩ - { ((⌽ ⍟(Rand∘2)rca){k𝕎𝕩}¨sh)_t 𝕩 }⎊1¨ p - { ((⊣`⍟(Rand∘2)rca){k𝕎𝕩}¨sh)_t 𝕩 }⎊1¨ m + { + k←𝕩 + p‿m ← (∊/⊣)⟜f¨ ⟨+⟩‿⟨-⟩ + rca ← ⟨RandChar,RandArith⟩ + Fit ← -⟜(@+1-˜17×2⋆16)⌈-⟜@⌊⊢ + { (⌽⍟(Rand 2) -∘Fit⟜-` rca{k𝕎𝕩}¨sh)_t 𝕩 }¨ p + { s←Rand 2⋄(Fit`⍟s(⊣`⍟(¬s)rca){k𝕎𝕩}¨sh)_t 𝕩 }¨ m + }⍟(0⊸<∧≤⟜5) 𝕨 } } |
