aboutsummaryrefslogtreecommitdiff
path: root/testsuite/awk.tests
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/awk.tests')
-rwxr-xr-xtestsuite/awk.tests28
1 files changed, 28 insertions, 0 deletions
diff --git a/testsuite/awk.tests b/testsuite/awk.tests
index 160f460a5..6af6072b8 100755
--- a/testsuite/awk.tests
+++ b/testsuite/awk.tests
@@ -44,6 +44,34 @@ testing "awk handles empty function f(arg){}" \
44 "L1\n\nL2\n\n" \ 44 "L1\n\nL2\n\n" \
45 "" "" 45 "" ""
46 46
47prg='
48function outer_fun() {
49 return 1
50}
51END {
52 i=1
53 print "L" i "\n"
54 i += outer_fun()
55 print "L" i "\n"
56}'
57testing "awk properly handles function from other scope" \
58 "awk '$prg'" \
59 "L1\n\nL2\n\n" \
60 "" ""
61
62prg='
63END {
64 i=1
65 print "L" i "\n"
66 i + trigger_error_fun()
67 print "L" i "\n"
68}'
69testing "awk properly handles undefined function" \
70 "awk '$prg' 2>&1" \
71 "L1\n\nawk: cmd. line:5: Call to undefined function\n" \
72 "" ""
73
74
47optional DESKTOP 75optional DESKTOP
48testing "awk hex const 1" "awk '{ print or(0xffffffff,1) }'" "4294967295\n" "" "\n" 76testing "awk hex const 1" "awk '{ print or(0xffffffff,1) }'" "4294967295\n" "" "\n"
49testing "awk hex const 2" "awk '{ print or(0x80000000,1) }'" "2147483649\n" "" "\n" 77testing "awk hex const 2" "awk '{ print or(0x80000000,1) }'" "2147483649\n" "" "\n"