diff options
Diffstat (limited to 'testsuite/awk.tests')
-rwxr-xr-x | testsuite/awk.tests | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/testsuite/awk.tests b/testsuite/awk.tests index 3933fefc9..0db6a26e4 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests | |||
@@ -280,6 +280,18 @@ testing "awk 'delete a[v--]' evaluates v-- once" \ | |||
280 | " \ | 280 | " \ |
281 | "" "" | 281 | "" "" |
282 | 282 | ||
283 | testing "awk func arg parsing 1" \ | ||
284 | "awk 'func f(,) { }' 2>&1" "awk: cmd. line:1: Unexpected token\n" "" "" | ||
285 | |||
286 | testing "awk func arg parsing 2" \ | ||
287 | "awk 'func f(a,,b) { }' 2>&1" "awk: cmd. line:1: Unexpected token\n" "" "" | ||
288 | |||
289 | testing "awk func arg parsing 3" \ | ||
290 | "awk 'func f(a,) { }' 2>&1" "awk: cmd. line:1: Unexpected token\n" "" "" | ||
291 | |||
292 | testing "awk func arg parsing 4" \ | ||
293 | "awk 'func f(a b) { }' 2>&1" "awk: cmd. line:1: Unexpected token\n" "" "" | ||
294 | |||
283 | testing "awk handles empty ()" \ | 295 | testing "awk handles empty ()" \ |
284 | "awk 'BEGIN {print()}' 2>&1" "awk: cmd. line:1: Empty sequence\n" "" "" | 296 | "awk 'BEGIN {print()}' 2>&1" "awk: cmd. line:1: Empty sequence\n" "" "" |
285 | 297 | ||
@@ -336,7 +348,13 @@ testing "awk continue" \ | |||
336 | 'BEGIN { if (1) continue; else a = 1 }' | 348 | 'BEGIN { if (1) continue; else a = 1 }' |
337 | 349 | ||
338 | testing "awk handles invalid for loop" \ | 350 | testing "awk handles invalid for loop" \ |
339 | "awk '{ for() }' 2>&1" "awk: cmd. line:1: Unexpected token\n" "" "" | 351 | "awk -e '{ for() }' 2>&1" "awk: cmd. line:1: Unexpected token\n" "" "" |
352 | |||
353 | testing "awk handles colon not preceded by ternary" \ | ||
354 | "awk -e foo:bar: 2>&1" "awk: cmd. line:1: Unexpected token\n" "" "" | ||
355 | |||
356 | testing "awk errors on missing delete arg" \ | ||
357 | "awk -e '{delete}' 2>&1" "awk: cmd. line:1: Too few arguments\n" "" "" | ||
340 | 358 | ||
341 | # testing "description" "command" "result" "infile" "stdin" | 359 | # testing "description" "command" "result" "infile" "stdin" |
342 | testing 'awk negative field access' \ | 360 | testing 'awk negative field access' \ |