summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
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 2c7642c..7910c88 100755
--- a/testsuite/awk.tests
+++ b/testsuite/awk.tests
@@ -47,4 +47,21 @@ testing "awk NF in BEGIN" \
":0::::\n" \
"" ""
+prg='
+function b(tmp) {
+ tmp = 0;
+ print "" tmp; #this line causes the bug
+ return tmp;
+}
+function c(tmpc) {
+ tmpc = b(); return tmpc;
+}
+BEGIN {
+ print (c() ? "string" : "number");
+}'
+testing "awk string cast (bug 725)" \
+ "awk '$prg'" \
+ "0\nnumber\n" \
+ "" ""
+
exit $FAILCOUNT