blob: 7f525325911233462b26b5841800f38584fecacf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#!/usr/bin/env nomsu -V1
#
Tests for the stuff defined in core/errors.nom
try: barf
..and if it succeeds: barf "try failed."
%worked <- (no)
try: barf
..and if it barfs: %worked <- (yes)
assume %worked or barf "try/catch failed"
%x <- 1
try
%x <- 2
do
barf
..then always
%x <- 3
..and if it barfs: do nothing
assume (%x = 3) or barf "do/then always failed"
say "Error handling test passed."
|