aboutsummaryrefslogtreecommitdiff
path: root/test/exe
blob: 3f1ea43a6e14a443a2ec0fcb688dae7b6563053f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#! /usr/bin/env dbqn

"usage: exe name [opts --] [tests]"!1≤≠•args

# BQN is called with the first argument, or all up to the last --
filesexe  args ⊔˜ 2 ∾˜ ⊑◶⟨1⌾⊑,«⊸(-<) ∨`⌾⌽ args≡¨<"--"

files  "prim"⟩⍟(0=) files

Include  ("! %"3⊸↑)  (0<)0('#'≠⊑)
Cases  Include¨⊸/ · FLines "cases/"∾∾⟜".bqn"
c   Cases¨ files
Trim  ((∨`∧∨`⌾⌽)' '⊸≠)/
ei  <˘⍉> ('%'= (∨´⊣)◶⟨"1"≍○<, Trim¨(+`-2⊸×)⊸⊔⟩ )¨ c

lf  @+10
codererr  {inp⇐∾∾⟜lf¨i∾⟨""⟩} SH exe
err ! 0code
rv  (BQN¨e) = (BQN "⟨"r"⟩")
np  ⍕≠c
Out (0<)◶⟨
  "All "np" passed!"˙
  (⍕≠)" of "np" failed:"∾·(lf⊸∾¨)⊏⟜c
 /1≢¨rv