diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-09-08 21:14:26 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-09-08 21:14:26 -0400 |
| commit | 2ff502e46f9d7e6929059479da2e160d0cbbf5de (patch) | |
| tree | 4bc056b8ffbdbd3e4f24cec4c7a68d8345b1bb07 /test/cmpref.bqn | |
| parent | 176c78f51809ba3648d7a4cdedc78553df5904ae (diff) | |
Organize tests scripts a little better and add README
Diffstat (limited to 'test/cmpref.bqn')
| -rwxr-xr-x | test/cmpref.bqn | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/test/cmpref.bqn b/test/cmpref.bqn deleted file mode 100755 index 23bccd17..00000000 --- a/test/cmpref.bqn +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env dbqn - -# Compile and run the primitive implementations, and testref.bqn - -impl ← •LNS •path∾"../src/r.bqn" - -drun ← ((<•path∾"../dc.bqn")∾<"DRun") •EX •path∾"../dzref" - -chrs←⟨ - "!+-×÷⋆√⌊⌈∧∨¬|=≠≤<>≥≡≢⊣⊢⥊∾≍↑↓↕⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔" - "˙˜˘¨⌜⁼´˝`" - "∘⊸⟜○⌾⎉⚇⍟◶⊘" -⟩ -nc ← ≠¨chrs -chr ← ∾chrs -itr ← 0⥊˜≠chr - -init ← " "⊸∾¨(/⟜"_"¨nc/0‿1‿1)∾¨(nc/"FMD")∾¨(nc+´⊸↑⥊"ABC"∾⌜•a) -post ← ∾⟜" "¨/⟜"_"¨nc/0‿0‿1 -names ← init∾¨'0'∾¨post - -Inc ← { - i←⊑chr⊐𝕩 - n←0 ⋄ itr↩{n↩1+𝕩}⌾(i⊑⊢)itr - names↩((i⊑init)∾('0'+n)∾i⊑post)⌾(i⊑⊢)names -} - -# built-in assumptions -Mod ← {((⊑chr⊐𝕨)⊑names) ∾ " ← " ∾ 𝕩} - -pre ← ⟨ - "IsArray ← 0≠≡" - "Type ← ⟨⟩⥊0⊸⥊" - "Log ← ⋆⁼" - "GroupLen← ≠¨⊔" - "GroupOrd← ∾⊔∘⊢" - '!' Mod "{𝕩 ⋄ ≤1}⍟(1≢⊢)" -⟩∾Mod⟜⥊¨ "+-×÷⋆⌊=≤≢⥊⊑↕⌜`⊘" - - -# checks if line is a builtin redefinition -E_isdef ← (3≤≠)◶⟨0,∧´⟨chr," ","←↩"⟩∊˜¨3⊸↑⟩ - -# removes comments and replaces built-ins with names -E_proc ← { - l←≠chr - q←≠`𝕩='"' ⋄ q∨↩≠`q<𝕩=''' ⋄ f←¬∨`q<𝕩='#' - ∾ (((l×f/q)+chr⊸⊐) (≥⟜l)◶⟨⊑⟜names,⥊∘⊢⟩¨ ⊢) f/𝕩 -} - -E_redef ← { # handles [fmd] [←↩] - tail ← E_proc 3↓𝕩 # must use old def - Inc ⊑𝕩 - (E_proc 1↑𝕩) ∾ "←" ∾ tail -} - -pre ∾↩ E_isdef◶E_proc‿E_redef¨ impl -t ← (¬∘⊑':'∊⊢)¨⊸/ 3⊸↓⌾(3⊸⊑) •LNS •path∾"testref.bqn" -res ← DRun ∾ ∾⟜(@+10)¨ pre ∾ E_proc¨ t -• ← ("All "∾(⍕≠res)∾" passed!")⍟(0=≠) /res |
