From f695b4db0d89d340cff046b17c04968824faf27e Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Thu, 1 Jul 2021 22:46:17 -0400 Subject: =?UTF-8?q?Fuzz=20testing=20for=20/=E2=8A=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/fuzz.bqn | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test') diff --git a/test/fuzz.bqn b/test/fuzz.bqn index 0043e62d..ae187fe6 100644 --- a/test/fuzz.bqn +++ b/test/fuzz.bqn @@ -184,12 +184,29 @@ _testDySearch ← { # ⊐⊒∊⍋⍒ as { ! 𝕨 𝕏 _testConsistent_ FlatMatch b }¨ {𝕏˜}⍟(∊˙⊸=)¨ 𝕗 } +RandRep ← -⟜»∘∧ 1⊸+⊸gen.Index⟜⥊ +_testIndices ← { # / + (RandRep○RandBound˜ 𝕩)⊸{ ! 𝕏 _testConsistent_ FlatMatch 𝕨 }¨ 𝕗 +} +_testSelect ← { # /⊏ + l‿sh ← (⍋≠¨)⊸⊏ RandShape¨ 𝕩‿𝕩 + n ← RandBound 𝕩 + d ← 𝕨 gen.Struct sh + RandInd ← 0⊸≠◶⟨⟨⟩,gen.Index⟜(⥊‿RandShape _randChoose)˜⟩ + g ← (/‿⊏ ⊐ 𝕗) ⊏ RandRep‿RandInd + g { ! (n𝕎 ⊑sh) 𝕏 _testConsistent_ FlatMatch d }¨ 𝕗 + g { ! (l𝕎¨l≠⊸↑sh) 𝕏 _testConsistent_ FlatMatch d }¨ 𝕗 +} + cases ← ⟨ ⟨∾`"+-×÷⋆√⌊⌈¬|"‿"∧∨≤<>≥=≠", testMonArith‿testDyArith⟩ ⟨"⥊≍⌽⍉⊏"‿"⥊↑↓↕⌽⍉", testMonStruct‿testDyStruct⟩ # Monadic «» hard to test ⟨"≠=≢"‿"", testDim‿@⟩ ⟨""‿"≍∾«»", @‿testCombine⟩ ⟨"⊐⊒∊⍷∧∨⍋⍒"‿"⊐⊒∊⍋⍒", testMonSearch‿testDySearch⟩ + ⟨"/"‿"/⊏", testIndices‿testSelect⟩ # ⊔ has nested result +# ↕<∾↑↓≡>⊑ % ⊑⍷ +# ˘⎉¨⚇⌜⁼⍟´˝` ⟩ MakeTests ← { prim‿test ← <∘>˘ ⍉> 𝕨 -- cgit v1.2.3