diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2011-03-30 22:02:26 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2011-03-30 22:02:26 +0200 |
commit | 0a4c1c5344b5d6c1750708675901509210497761 (patch) | |
tree | 96b0b7bd7ad9aea07033456b6412c2faeabaca07 /test/next.sh | |
parent | 86d89c929013e64bf4e4b28af2facd549c3bfaba (diff) | |
download | gawk-0a4c1c5344b5d6c1750708675901509210497761.tar.gz |
Add tests for next and exit to test suite.
Diffstat (limited to 'test/next.sh')
-rwxr-xr-x | test/next.sh | 20 |
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 |