aboutsummaryrefslogtreecommitdiff
path: root/testsuite/awk.tests
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/awk.tests')
-rwxr-xr-xtestsuite/awk.tests19
1 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/awk.tests b/testsuite/awk.tests
index f9c3b6b4d..dad49c3f5 100755
--- a/testsuite/awk.tests
+++ b/testsuite/awk.tests
@@ -25,6 +25,25 @@ testing "awk if string == " "awk 'BEGIN{if(\"a\"==\"ab\") print \"bar\"}'" ""
25 25
26# 4294967295 = 0xffffffff 26# 4294967295 = 0xffffffff
27testing "awk bitwise op" "awk '{ print or(4294967295,1) }'" "4.29497e+09\n" "" "\n" 27testing "awk bitwise op" "awk '{ print or(4294967295,1) }'" "4.29497e+09\n" "" "\n"
28
29# we were testing for a non-empty body when deciding if a function was
30# defined or not. The testcase below caused:
31# awk: cmd. line:8: Call to undefined function
32prg='
33function empty_fun(count) {
34 # empty
35}
36END {
37 i=1
38 print "L" i "\n"
39 empty_fun(i + i + ++i)
40 print "L" i "\n"
41}'
42testing "awk handles empty function f(arg){}" \
43 "awk '$prg'" \
44 "L1\n\nL2\n\n" \
45 "" ""
46
28optional DESKTOP 47optional DESKTOP
29testing "awk hex const 1" "awk '{ print or(0xffffffff,1) }'" "4.29497e+09\n" "" "\n" 48testing "awk hex const 1" "awk '{ print or(0xffffffff,1) }'" "4.29497e+09\n" "" "\n"
30testing "awk hex const 2" "awk '{ print or(0x80000000,1) }'" "2.14748e+09\n" "" "\n" 49testing "awk hex const 2" "awk '{ print or(0x80000000,1) }'" "2.14748e+09\n" "" "\n"