diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2013-07-22 11:49:06 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-07-22 11:49:06 +0200 |
commit | b855460adcda8dfb18ac36755f128ce32088ae87 (patch) | |
tree | 6be4466649292e27d560abfd637a978c92c40ad9 | |
parent | b0e9b72915a87121aabf21d4e382e16e0a9a5175 (diff) | |
download | busybox-w32-b855460adcda8dfb18ac36755f128ce32088ae87.tar.gz busybox-w32-b855460adcda8dfb18ac36755f128ce32088ae87.tar.bz2 busybox-w32-b855460adcda8dfb18ac36755f128ce32088ae87.zip |
awk.tests: add test for recent large integer fix
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rwxr-xr-x | testsuite/awk.tests | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/testsuite/awk.tests b/testsuite/awk.tests index dad49c3f5..160f460a5 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests | |||
@@ -24,7 +24,7 @@ testing "awk if operator < " "awk 'BEGIN{if(2 < 13) print \"foo\"}'" "foo\n" " | |||
24 | testing "awk if string == " "awk 'BEGIN{if(\"a\"==\"ab\") print \"bar\"}'" "" "" "" | 24 | 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) }'" "4294967295\n" "" "\n" |
28 | 28 | ||
29 | # we were testing for a non-empty body when deciding if a function was | 29 | # we were testing for a non-empty body when deciding if a function was |
30 | # defined or not. The testcase below caused: | 30 | # defined or not. The testcase below caused: |
@@ -45,8 +45,8 @@ testing "awk handles empty function f(arg){}" \ | |||
45 | "" "" | 45 | "" "" |
46 | 46 | ||
47 | optional DESKTOP | 47 | optional DESKTOP |
48 | 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) }'" "4294967295\n" "" "\n" |
49 | 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) }'" "2147483649\n" "" "\n" |
50 | testing "awk oct const" "awk '{ print or(01234,1) }'" "669\n" "" "\n" | 50 | testing "awk oct const" "awk '{ print or(01234,1) }'" "669\n" "" "\n" |
51 | SKIP= | 51 | SKIP= |
52 | 52 | ||
@@ -241,6 +241,11 @@ testing "awk FS assignment" "awk '{FS=\":\"; print \$1}'" \ | |||
241 | "" \ | 241 | "" \ |
242 | "a:b c:d\ne:f g:h" | 242 | "a:b c:d\ne:f g:h" |
243 | 243 | ||
244 | testing "awk large integer" \ | ||
245 | "awk 'BEGIN{n=(2^31)-1; print n, int(n), n%1, ++n, int(n), n%1}'" \ | ||
246 | "2147483647 2147483647 0 2147483648 2147483648 0\n" \ | ||
247 | "" "" | ||
248 | |||
244 | # testing "description" "command" "result" "infile" "stdin" | 249 | # testing "description" "command" "result" "infile" "stdin" |
245 | 250 | ||
246 | exit $FAILCOUNT | 251 | exit $FAILCOUNT |