#! /usr/bin/env dbqn nc‿rt‿ref ← "-nocomp"‿"-rt"‿"-ref" ∊ •args files ← "simple"‿"syntax"‿"prim"⍟(0=≠) ('-'≠⊑)¨⊸/ •args "Can't test runtime without the compiler!" ! ¬nc∧rt∨ref Native ← •BQN exec ← { nc ? Native ; # Otherwise compiled ⟨DRun⟩ ← •Import "dc.bqn" r ← { ref ? •Import "ref.bqn" ; # Reference implementations rt ? •Import "dzrt.bqn" ; # Self-hosted •BQN∘⥊¨ ∾ •Import "../src/glyphs.bqn" # Native runtime } r⊸DRun } Cases ← (0<≠)◶0‿('#'≠⊑)¨⊸/ · •FLines "cases/"∾∾⟜".bqn" c ← ∾ Cases¨ files Trim ← ((∨`∧∨`⌾⌽)' '⊸≠)⊸/ M ← {e‿b: Msg ← {∾⟨ """",b,""": expected " "to fail"⍟("!"⊸≡)e " but " 0⊸≡◶⟨"received "∾2•Fmt⊑,"evaluation failed"⟩𝕩 ⥊@+10 ⟩} ("!"⊸≡◶⟨