diff options
Diffstat (limited to 'testsuite/awk.tests')
-rwxr-xr-x | testsuite/awk.tests | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/awk.tests b/testsuite/awk.tests index 132afc6a9..9e6952ffd 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests | |||
@@ -295,6 +295,22 @@ testing "awk -e and ARGC" \ | |||
295 | "" | 295 | "" |
296 | SKIP= | 296 | SKIP= |
297 | 297 | ||
298 | # The examples are in fact not valid awk programs (break/continue | ||
299 | # can only be used inside loops). | ||
300 | # But we do accept them outside of loops. | ||
301 | # We had a bug with misparsing "break ; else" sequence. | ||
302 | # Test that *that* bug is fixed, using simplest possible scripts: | ||
303 | testing "awk break" \ | ||
304 | "awk -f - 2>&1; echo \$?" \ | ||
305 | "0\n" \ | ||
306 | "" \ | ||
307 | 'BEGIN { if (1) break; else a = 1 }' | ||
308 | testing "awk continue" \ | ||
309 | "awk -f - 2>&1; echo \$?" \ | ||
310 | "0\n" \ | ||
311 | "" \ | ||
312 | 'BEGIN { if (1) continue; else a = 1 }' | ||
313 | |||
298 | # testing "description" "command" "result" "infile" "stdin" | 314 | # testing "description" "command" "result" "infile" "stdin" |
299 | 315 | ||
300 | exit $FAILCOUNT | 316 | exit $FAILCOUNT |