diff options
author | Brian Foley <bpfoley@google.com> | 2019-01-01 13:40:59 -0800 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2019-01-21 12:55:49 +0100 |
commit | 08a514c097f1451678940a3178a9565b9d65a193 (patch) | |
tree | f86e7566847b02108eb243ad79f25345e6ba58ec /testsuite | |
parent | dac15a10accc6921d1559d254ceed9fe9d092ddf (diff) | |
download | busybox-w32-08a514c097f1451678940a3178a9565b9d65a193.tar.gz busybox-w32-08a514c097f1451678940a3178a9565b9d65a193.tar.bz2 busybox-w32-08a514c097f1451678940a3178a9565b9d65a193.zip |
awk: Syntax error if delete isn't given an arg.
Unlike exit and return, delete strictly requires an arg, and derefs a
null pointer if executed without one.
Signed-off-by: Brian Foley <bpfoley@google.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/awk.tests | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/testsuite/awk.tests b/testsuite/awk.tests index 9f353fc10..03fedf771 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests | |||
@@ -336,10 +336,13 @@ testing "awk continue" \ | |||
336 | 'BEGIN { if (1) continue; else a = 1 }' | 336 | 'BEGIN { if (1) continue; else a = 1 }' |
337 | 337 | ||
338 | testing "awk handles invalid for loop" \ | 338 | testing "awk handles invalid for loop" \ |
339 | "awk '{ for() }' 2>&1" "awk: cmd. line:1: Unexpected token\n" "" "" | 339 | "awk -e '{ for() }' 2>&1" "awk: cmd. line:1: Unexpected token\n" "" "" |
340 | 340 | ||
341 | testing "awk handles colon not preceded by ternary" \ | 341 | testing "awk handles colon not preceded by ternary" \ |
342 | "awk 'foo:bar:' 2>&1" "awk: cmd. line:1: Unexpected token\n" "" "" | 342 | "awk -e foo:bar: 2>&1" "awk: cmd. line:1: Unexpected token\n" "" "" |
343 | |||
344 | testing "awk errors on missing delete arg" \ | ||
345 | "awk -e '{delete}' 2>&1" "awk: cmd. line:1: Too few arguments\n" "" "" | ||
343 | 346 | ||
344 | # testing "description" "command" "result" "infile" "stdin" | 347 | # testing "description" "command" "result" "infile" "stdin" |
345 | testing 'awk negative field access' \ | 348 | testing 'awk negative field access' \ |