summaryrefslogtreecommitdiff
path: root/test/next.sh
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2011-03-30 22:02:26 +0200
committerArnold D. Robbins <arnold@skeeve.com>2011-03-30 22:02:26 +0200
commit0a4c1c5344b5d6c1750708675901509210497761 (patch)
tree96b0b7bd7ad9aea07033456b6412c2faeabaca07 /test/next.sh
parent86d89c929013e64bf4e4b28af2facd549c3bfaba (diff)
downloadgawk-0a4c1c5344b5d6c1750708675901509210497761.tar.gz
Add tests for next and exit to test suite.
Diffstat (limited to 'test/next.sh')
-rwxr-xr-xtest/next.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/next.sh b/test/next.sh
new file mode 100755
index 00000000..77354a25
--- /dev/null
+++ b/test/next.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# next.sh --- test next invoked in various ways
+
+if [ "$AWK" = "" ]
+then
+ echo $0: You must set AWK >&2
+ exit 1
+fi
+
+# non-fatal
+$AWK '{next}' /dev/null
+$AWK 'function f() { next}; {f()}' /dev/null
+# fatal
+$AWK 'function f() { next}; BEGIN{f()}'
+$AWK 'function f() { next}; {f()}; END{f()}' /dev/null
+$AWK 'function f() { next}; BEGINFILE{f()}'
+$AWK 'function f() { next}; {f()}; ENDFILE{f()}' /dev/null
+
+exit 0 # for make