[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, feature/fixtype, updated. gawk-4.1.0-185
From: |
Andrew J. Schorr |
Subject: |
[gawk-diffs] [SCM] gawk branch, feature/fixtype, updated. gawk-4.1.0-1855-g9d9f63e |
Date: |
Wed, 22 Jun 2016 12:13:10 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".
The branch, feature/fixtype has been updated
via 9d9f63e5f27ea49493fc885e4e29e3196e72f601 (commit)
from 2d2744ec74076d29e94a2a004e308f73a86b9fa5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=9d9f63e5f27ea49493fc885e4e29e3196e72f601
commit 9d9f63e5f27ea49493fc885e4e29e3196e72f601
Author: Andrew J. Schorr <address@hidden>
Date: Wed Jun 22 08:12:53 2016 -0400
Improve strnum test case to check both OFMT and CONVFMT formatting.
diff --git a/test/ChangeLog b/test/ChangeLog
index 5a57584..f5dbd57 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2016-06-22 Andrew J. Schorr <address@hidden>
+
+ * strnum2.awk, strnum2.ok: Improve test case to show both OFMT and
+ CONVFMT conversions.
+
2016-06-20 Andrew J. Schorr <address@hidden>
* Makefile.am (strnum2): New test.
diff --git a/test/Makefile.in b/test/Makefile.in
index 11176f1..be42a25 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1256,6 +1256,8 @@ EXTRA_DIST = \
strftlng.ok \
strnum1.awk \
strnum1.ok \
+ strnum2.awk \
+ strnum2.ok \
strtod.awk \
strtod.in \
strtod.ok \
@@ -1421,7 +1423,7 @@ BASIC_TESTS = \
reparse resplit rri1 rs rscompat rsnul1nl rsnulbig rsnulbig2 rstest1
rstest2 \
rstest3 rstest4 rstest5 rswhite \
scalar sclforin sclifin sigpipe1 sortempty sortglos splitargv splitarr
splitdef \
- splitvar splitwht strcat1 strnum1 strtod subamp subback subi18n \
+ splitvar splitwht strcat1 strnum1 strnum2 strtod subamp subback subi18n
\
subsepnm subslash substr swaplns synerr1 synerr2 tradanch tweakfld \
uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs \
wideidx wideidx2 widesub widesub2 widesub3 widesub4 wjposer1 \
@@ -3647,6 +3649,11 @@ strnum1:
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+strnum2:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
strtod:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden <
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index 4ee6f38..f42ecdc 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -897,6 +897,11 @@ strnum1:
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+strnum2:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
strtod:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden <
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/strnum2.awk b/test/strnum2.awk
index 16e6f5d..44931d5 100644
--- a/test/strnum2.awk
+++ b/test/strnum2.awk
@@ -1,10 +1,18 @@
BEGIN {
- split("1.234", f)
+ split(" 1.234 ", f, "|") # create a numeric string (strnum) value
OFMT = "%.1f"
- # check whether strnum is displayed the same way before and
+ CONVFMT = "%.2f"
+
+ # Check whether a strnum is displayed the same way before and
# after force_number is called. Also, should numeric strings
- # be formatted with OFMT or show the original string value?
- print f[1]
- x = f[1]+0 # trigger conversion to NUMBER
- print f[1]
+ # be formatted with OFMT and CONVFMT or show the original string value?
+
+ print f[1] # OFMT
+ print (f[1] "") # CONVFMT
+
+ # force conversion to NUMBER if it has not happened already
+ x = f[1]+0
+
+ print f[1] # OFMT
+ print (f[1] "") # CONVFMT
}
diff --git a/test/strnum2.ok b/test/strnum2.ok
index f5103ca..65cfbde 100644
--- a/test/strnum2.ok
+++ b/test/strnum2.ok
@@ -1,2 +1,4 @@
1.2
+1.23
1.2
+1.23
-----------------------------------------------------------------------
Summary of changes:
test/ChangeLog | 5 +++++
test/Makefile.in | 9 ++++++++-
test/Maketests | 5 +++++
test/strnum2.awk | 20 ++++++++++++++------
test/strnum2.ok | 2 ++
5 files changed, 34 insertions(+), 7 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, feature/fixtype, updated. gawk-4.1.0-1855-g9d9f63e,
Andrew J. Schorr <=