aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-11-30 01:15:04 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2009-11-30 01:15:04 +0100
commit1284774d60ebce68dec6fcaf44a33e928c4c1f82 (patch)
tree165bc1ec980eca2d30b04d7939bafbf7667fc1b8 /testsuite
parentcdeda16ee4acb78569598e848a491ad595af3abb (diff)
downloadbusybox-w32-1284774d60ebce68dec6fcaf44a33e928c4c1f82.tar.gz
busybox-w32-1284774d60ebce68dec6fcaf44a33e928c4c1f82.tar.bz2
busybox-w32-1284774d60ebce68dec6fcaf44a33e928c4c1f82.zip
awk: fix an incorrect casting to string (bug 725). -44 bytes.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/awk.tests17
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/awk.tests b/testsuite/awk.tests
index 2c7642ce0..7910c8875 100755
--- a/testsuite/awk.tests
+++ b/testsuite/awk.tests
@@ -47,4 +47,21 @@ testing "awk NF in BEGIN" \
47 ":0::::\n" \ 47 ":0::::\n" \
48 "" "" 48 "" ""
49 49
50prg='
51function b(tmp) {
52 tmp = 0;
53 print "" tmp; #this line causes the bug
54 return tmp;
55}
56function c(tmpc) {
57 tmpc = b(); return tmpc;
58}
59BEGIN {
60 print (c() ? "string" : "number");
61}'
62testing "awk string cast (bug 725)" \
63 "awk '$prg'" \
64 "0\nnumber\n" \
65 "" ""
66
50exit $FAILCOUNT 67exit $FAILCOUNT