diff options
Diffstat (limited to 'testsuite/awk.tests')
-rwxr-xr-x | testsuite/awk.tests | 28 |
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 | ||
47 | prg=' | ||
48 | function outer_fun() { | ||
49 | return 1 | ||
50 | } | ||
51 | END { | ||
52 | i=1 | ||
53 | print "L" i "\n" | ||
54 | i += outer_fun() | ||
55 | print "L" i "\n" | ||
56 | }' | ||
57 | testing "awk properly handles function from other scope" \ | ||
58 | "awk '$prg'" \ | ||
59 | "L1\n\nL2\n\n" \ | ||
60 | "" "" | ||
61 | |||
62 | prg=' | ||
63 | END { | ||
64 | i=1 | ||
65 | print "L" i "\n" | ||
66 | i + trigger_error_fun() | ||
67 | print "L" i "\n" | ||
68 | }' | ||
69 | testing "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 | |||
47 | optional DESKTOP | 75 | optional DESKTOP |
48 | testing "awk hex const 1" "awk '{ print or(0xffffffff,1) }'" "4294967295\n" "" "\n" | 76 | testing "awk hex const 1" "awk '{ print or(0xffffffff,1) }'" "4294967295\n" "" "\n" |
49 | testing "awk hex const 2" "awk '{ print or(0x80000000,1) }'" "2147483649\n" "" "\n" | 77 | testing "awk hex const 2" "awk '{ print or(0x80000000,1) }'" "2147483649\n" "" "\n" |