#! /usr/bin/env dbqn nc‿rt ← "-nocomp"‿"-rt" ∊ •args files ← "simple"‿"syntax"‿"prim"⍟(0=≠) ('-'≠⊑)¨⊸/ •args "Can't test runtime without the compiler!" ! ¬nc∧rt ⟨DRun,DCompile⟩ ← •Import "../dc.bqn" GetRT ← {𝕤: ⟨ref,glyphs⟩ ← •Import "../src/pr.bqn" PrimInd ← {⊑rt⊐<𝕩} Decompose ← ((≠glyphs)>PrimInd)◶⟨•Decompose,0⊸≍⟩ provide ← ⟨ •Type # Type Decompose # Decompose glyphs⊑˜PrimInd # Glyph ⊑⟨⟩⥊0⊸⥊ # GetFill ⋆⁼ # Log ≠¨⊔ # GroupLen ∾⊔∘⊢ # GroupOrd !,+,-,×,÷,⋆,⌊,=,≤,≢,⥊,⊑,↕,⌜,`,⊘ ⟩ rt ← •COMP provide⊸(⊣»«)⌾(1⊸⊑) DCompile ref } Native ← {⍎𝕩} exec ← (rt¬nc)◶⟨Native˙, DRun˙, {𝕩⊸DRun}∘GetRT⟩ @ Cases ← (0<≠)◶0‿('#'≠⊑)¨⊸/ · •FLines "cases/"∾∾⟜".bqn" c ← ∾ Cases¨ files Trim ← ((∨`∧∨`⌾⌽)' '⊸≠)⊸/ M ← {e‿b: Msg ← {∾⟨ """",b,""": expected " "to fail"⍟("!"⊸≡)e " but " 0⊸≡◶⟨"received "∾2•Pretty⊑,"evaluation failed"⟩𝕩 ⥊@+10 ⟩} ("!"⊸≡◶⟨