diff options
Diffstat (limited to 'testsuite/awk.tests')
-rwxr-xr-x | testsuite/awk.tests | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/awk.tests b/testsuite/awk.tests index 82937bc10..ad0583afb 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests | |||
@@ -261,6 +261,25 @@ end d | |||
261 | " \ | 261 | " \ |
262 | "" "" | 262 | "" "" |
263 | 263 | ||
264 | prg=' | ||
265 | BEGIN{ | ||
266 | cnt = 0 | ||
267 | a[cnt] = "zeroth" | ||
268 | a[++cnt] = "first" | ||
269 | delete a[cnt--] | ||
270 | print cnt | ||
271 | print "[0]:" a[0] | ||
272 | print "[1]:" a[1] | ||
273 | }' | ||
274 | testing "awk 'delete a[v--]' evaluates v-- once" \ | ||
275 | "awk '$prg'" \ | ||
276 | "\ | ||
277 | 0 | ||
278 | [0]:zeroth | ||
279 | [1]: | ||
280 | " \ | ||
281 | "" "" | ||
282 | |||
264 | testing "awk handles empty ()" \ | 283 | testing "awk handles empty ()" \ |
265 | "awk 'BEGIN {print()}' 2>&1" "awk: cmd. line:1: Empty sequence\n" "" "" | 284 | "awk 'BEGIN {print()}' 2>&1" "awk: cmd. line:1: Empty sequence\n" "" "" |
266 | 285 | ||