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 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 |
27 | testing "awk bitwise op" "awk '{ print or(4294967295,1) }'" "4.29497e+09\n" "" "\n" | 27 | testing "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 | ||
32 | prg=' | ||
33 | function empty_fun(count) { | ||
34 | # empty | ||
35 | } | ||
36 | END { | ||
37 | i=1 | ||
38 | print "L" i "\n" | ||
39 | empty_fun(i + i + ++i) | ||
40 | print "L" i "\n" | ||
41 | }' | ||
42 | testing "awk handles empty function f(arg){}" \ | ||
43 | "awk '$prg'" \ | ||
44 | "L1\n\nL2\n\n" \ | ||
45 | "" "" | ||
46 | |||
28 | optional DESKTOP | 47 | optional DESKTOP |
29 | testing "awk hex const 1" "awk '{ print or(0xffffffff,1) }'" "4.29497e+09\n" "" "\n" | 48 | testing "awk hex const 1" "awk '{ print or(0xffffffff,1) }'" "4.29497e+09\n" "" "\n" |
30 | testing "awk hex const 2" "awk '{ print or(0x80000000,1) }'" "2.14748e+09\n" "" "\n" | 49 | testing "awk hex const 2" "awk '{ print or(0x80000000,1) }'" "2.14748e+09\n" "" "\n" |