aboutsummaryrefslogtreecommitdiff
path: root/test/dz_comp
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-12-15 10:47:23 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-12-15 10:47:30 -0500
commit9bc63c92daccacf9580207b0766350e99186bad9 (patch)
tree7a1abaf9a96f82e2b69dfdca7797a67f6ec773fa /test/dz_comp
parentca01e1ae0e07999f145a96363dbaf2cf5416a84a (diff)
Allow test cases to require failure with "! % test"
Diffstat (limited to 'test/dz_comp')
-rwxr-xr-xtest/dz_comp10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/dz_comp b/test/dz_comp
index f8d69c57..49847fef 100755
--- a/test/dz_comp
+++ b/test/dz_comp
@@ -30,8 +30,14 @@ Cases ← (0<≠)◶0‿('#'≠⊑)¨⊸/ · •FLines "cases/"∾∾⟜".bqn"
c ← ∾ Cases¨ files
Trim ← ((∨`∧∨`⌾⌽)' '⊸≠)⊸/
M ← {e‿b:
- Msg ← {(@+10)∾˜""""∾b∾""": expected "∾e∾" but "∾0⊸≢◶⟨"evaluation failed","received "∾·⍕⊑⟩𝕩}
- (<Native e) ≢◶""‿Msg <∘Exec⎊0 b
+ Msg ← {∾⟨
+ """",b,""": expected "
+ "to fail"⍟("!"⊸≡)e
+ " but "
+ 0⊸≡◶⟨"received "∾·⍕⊑,"evaluation failed"⟩𝕩
+ ⥊@+10
+ ⟩}
+ ("!"⊸≡◶⟨<Native,0˙⟩ e) ≢◶""‿Msg <∘Exec⎊0 b
}
r ← (M '%'⊸= (∨´⊣)◶⟨"1"≍○<⊢, Trim¨(+`-2⊸×)⊸⊔⟩ ⊢)¨ c
•Out ("All "∾(⍕≠c)∾" passed!")⍟(0=≠) ∾r