From 2d2744ec74076d29e94a2a004e308f73a86b9fa5 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Mon, 20 Jun 2016 10:10:30 -0400 Subject: Call fixtype in a few more places to make sure we check types properly. --- test/ChangeLog | 5 +++++ test/Makefile.am | 4 +++- test/strnum2.awk | 10 ++++++++++ test/strnum2.ok | 2 ++ 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 test/strnum2.awk create mode 100644 test/strnum2.ok (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index e667de55..5a575841 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2016-06-20 Andrew J. Schorr + + * Makefile.am (strnum2): New test. + * strnum2.awk, strnum2.ok: New files. + 2016-06-14 Arnold D. Robbins * Makefile.am (subback): New test. diff --git a/test/Makefile.am b/test/Makefile.am index 6c893cce..499107c5 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -999,6 +999,8 @@ EXTRA_DIST = \ strftlng.ok \ strnum1.awk \ strnum1.ok \ + strnum2.awk \ + strnum2.ok \ strtod.awk \ strtod.in \ strtod.ok \ @@ -1165,7 +1167,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 \ diff --git a/test/strnum2.awk b/test/strnum2.awk new file mode 100644 index 00000000..16e6f5d0 --- /dev/null +++ b/test/strnum2.awk @@ -0,0 +1,10 @@ +BEGIN { + split("1.234", f) + OFMT = "%.1f" + # check whether 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] +} diff --git a/test/strnum2.ok b/test/strnum2.ok new file mode 100644 index 00000000..f5103ca9 --- /dev/null +++ b/test/strnum2.ok @@ -0,0 +1,2 @@ +1.2 +1.2 -- cgit v1.2.3