diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | test/ChangeLog | 5 | ||||
-rw-r--r-- | test/Makefile.am | 5 | ||||
-rw-r--r-- | test/Makefile.in | 10 | ||||
-rw-r--r-- | test/Maketests | 5 | ||||
-rw-r--r-- | test/ofmtstrnum.awk | 7 | ||||
-rw-r--r-- | test/ofmtstrnum.ok | 2 |
7 files changed, 37 insertions, 2 deletions
@@ -1,3 +1,8 @@ +2016-07-23 Andrew J. Schorr <aschorr@telemetry-investments.com> + + * builtin.c (do_print): Improve logic for formatting + numeric values. + 2016-07-19 Andrew J. Schorr <aschorr@telemetry-investments.com> * eval.c (set_LINT): Simplify the code considerably. diff --git a/test/ChangeLog b/test/ChangeLog index 7d800fb0..08196ead 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2015-06-17 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (ofmtstrnum): New test. + * ofmtstrnu.awk, ofmtstrnum.ok: New files. + 2016-07-20 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (EXTRA_DIST): Remove clos1way6.ok2. diff --git a/test/Makefile.am b/test/Makefile.am index 3a51b3ff..5fa153eb 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -720,6 +720,8 @@ EXTRA_DIST = \ ofmts.awk \ ofmts.in \ ofmts.ok \ + ofmtstrnum.awk \ + ofmtstrnum.ok \ ofs1.awk \ ofs1.in \ ofs1.ok \ @@ -1159,7 +1161,8 @@ BASIC_TESTS = \ nasty nasty2 negexp negrange nested nfldstr nfloop nfneg nfset nlfldsep \ nlinstr nlstrina noeffect nofile nofmtch noloop1 noloop2 nonl \ noparms nors nulinsrc nulrsend numindex numsubstr \ - octsub ofmt ofmta ofmtbig ofmtfidl ofmts ofs1 onlynl opasnidx opasnslf \ + octsub ofmt ofmta ofmtbig ofmtfidl ofmts ofmtstrnum ofs1 onlynl \ + opasnidx opasnslf \ paramasfunc1 paramasfunc2 \ paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \ pcntplus posix2008sub prdupval prec printf0 printf1 printfchar prmarscl prmreuse \ diff --git a/test/Makefile.in b/test/Makefile.in index 29064326..900054f7 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -977,6 +977,8 @@ EXTRA_DIST = \ ofmts.awk \ ofmts.in \ ofmts.ok \ + ofmtstrnum.awk \ + ofmtstrnum.ok \ ofs1.awk \ ofs1.in \ ofs1.ok \ @@ -1415,7 +1417,8 @@ BASIC_TESTS = \ nasty nasty2 negexp negrange nested nfldstr nfloop nfneg nfset nlfldsep \ nlinstr nlstrina noeffect nofile nofmtch noloop1 noloop2 nonl \ noparms nors nulinsrc nulrsend numindex numsubstr \ - octsub ofmt ofmta ofmtbig ofmtfidl ofmts ofs1 onlynl opasnidx opasnslf \ + octsub ofmt ofmta ofmtbig ofmtfidl ofmts ofmtstrnum ofs1 onlynl \ + opasnidx opasnslf \ paramasfunc1 paramasfunc2 \ paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \ pcntplus posix2008sub prdupval prec printf0 printf1 printfchar prmarscl prmreuse \ @@ -3380,6 +3383,11 @@ ofmts: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +ofmtstrnum: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + ofs1: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 525a44d1..16586ae9 100644 --- a/test/Maketests +++ b/test/Maketests @@ -625,6 +625,11 @@ ofmts: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +ofmtstrnum: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + ofs1: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/ofmtstrnum.awk b/test/ofmtstrnum.awk new file mode 100644 index 00000000..805dad73 --- /dev/null +++ b/test/ofmtstrnum.awk @@ -0,0 +1,7 @@ +BEGIN { + split(" 1", f, "|") + OFMT = "%.1f" + print f[1] + x = f[1] + 0 + print f[1] +} diff --git a/test/ofmtstrnum.ok b/test/ofmtstrnum.ok new file mode 100644 index 00000000..ae955868 --- /dev/null +++ b/test/ofmtstrnum.ok @@ -0,0 +1,2 @@ + 1 + 1 |