summaryrefslogtreecommitdiff
path: root/yarn.tests
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2013-07-04 08:18:05 +0100
committerLars Wirzenius <liw@liw.fi>2013-07-04 08:18:05 +0100
commitba5af12ef073791914c94d06592ab40eb632ad4b (patch)
tree40463ba766a9222f56607086377ec2fda8bcb372 /yarn.tests
parentfaff7b2b536218669216593068f063611cf80dab (diff)
downloadcmdtest-ba5af12ef073791914c94d06592ab40eb632ad4b.tar.gz
Add test case for FINALLY
Diffstat (limited to 'yarn.tests')
-rwxr-xr-xyarn.tests/finally.script26
1 files changed, 26 insertions, 0 deletions
diff --git a/yarn.tests/finally.script b/yarn.tests/finally.script
new file mode 100755
index 0000000..2d383a0
--- /dev/null
+++ b/yarn.tests/finally.script
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+set -eu
+
+cat <<EOF > "$DATADIR/finally.yarn"
+ SCENARIO finally
+ GIVEN nothing
+ WHEN nothing
+ THEN nothing
+ FINALLY yeehaa
+
+ IMPLEMENTS GIVEN nothing
+ true
+
+ IMPLEMENTS WHEN nothing
+ true
+
+ IMPLEMENTS THEN nothing
+ true
+
+ IMPLEMENTS FINALLY yeehaa
+ touch "$DATADIR/finally.has.run"
+EOF
+
+./yarn -q "$DATADIR/finally.yarn"
+test -e "$DATADIR/finally.has.run"