From 08a514c097f1451678940a3178a9565b9d65a193 Mon Sep 17 00:00:00 2001 From: Brian Foley Date: Tue, 1 Jan 2019 13:40:59 -0800 Subject: 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 Signed-off-by: Denys Vlasenko --- testsuite/awk.tests | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'testsuite/awk.tests') 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" \ 'BEGIN { if (1) continue; else a = 1 }' testing "awk handles invalid for loop" \ - "awk '{ for() }' 2>&1" "awk: cmd. line:1: Unexpected token\n" "" "" + "awk -e '{ for() }' 2>&1" "awk: cmd. line:1: Unexpected token\n" "" "" testing "awk handles colon not preceded by ternary" \ - "awk 'foo:bar:' 2>&1" "awk: cmd. line:1: Unexpected token\n" "" "" + "awk -e foo:bar: 2>&1" "awk: cmd. line:1: Unexpected token\n" "" "" + +testing "awk errors on missing delete arg" \ + "awk -e '{delete}' 2>&1" "awk: cmd. line:1: Too few arguments\n" "" "" # testing "description" "command" "result" "infile" "stdin" testing 'awk negative field access' \ -- cgit v1.2.3