aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog5
-rw-r--r--test/Makefile.am5
-rw-r--r--test/Makefile.in10
-rw-r--r--test/Maketests5
-rw-r--r--test/mpfrcase2.awk19
-rw-r--r--test/mpfrcase2.in1
-rw-r--r--test/mpfrcase2.ok1
7 files changed, 44 insertions, 2 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 9a9922f2..b741651e 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2020-07-07 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (EXTRA_DIST): New test, mpfrcase2.
+ * mpfrcase2.awk, mpfrcase2.in, mpfrcase2.ok: New files.
+
2020-07-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
* Makefile.am (AWK): Append $(GAWK_TEST_ARGS) to enable running
diff --git a/test/Makefile.am b/test/Makefile.am
index b7e3240f..76634925 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -703,6 +703,9 @@ EXTRA_DIST = \
mpfrcase.awk \
mpfrcase.in \
mpfrcase.ok \
+ mpfrcase2.awk \
+ mpfrcase2.in \
+ mpfrcase2.ok \
mpfrexprange.awk \
mpfrexprange.ok \
mpfrfield.awk \
@@ -1467,7 +1470,7 @@ NEED_LINT = \
NEED_LINT_OLD = lintold
# List of tests that must be run with -M
-NEED_MPFR = mpfrbigint mpfrbigint2 mpfrcase mpfrexprange mpfrfield mpfrieee mpfrmemok1 \
+NEED_MPFR = mpfrbigint mpfrbigint2 mpfrcase mpfrcase2 mpfrexprange mpfrfield mpfrieee mpfrmemok1 \
mpfrnegzero mpfrnonum mpfrnr mpfrrem mpfrrnd mpfrrndeval mpfrsort mpfrsqrt \
mpfrstrtonum mpgforcenum mpfruplus mpfranswer42
diff --git a/test/Makefile.in b/test/Makefile.in
index afa233fb..4af1a7ba 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -966,6 +966,9 @@ EXTRA_DIST = \
mpfrcase.awk \
mpfrcase.in \
mpfrcase.ok \
+ mpfrcase2.awk \
+ mpfrcase2.in \
+ mpfrcase2.ok \
mpfrexprange.awk \
mpfrexprange.ok \
mpfrfield.awk \
@@ -1728,7 +1731,7 @@ NEED_LINT = \
NEED_LINT_OLD = lintold
# List of tests that must be run with -M
-NEED_MPFR = mpfrbigint mpfrbigint2 mpfrcase mpfrexprange mpfrfield mpfrieee mpfrmemok1 \
+NEED_MPFR = mpfrbigint mpfrbigint2 mpfrcase mpfrcase2 mpfrexprange mpfrfield mpfrieee mpfrmemok1 \
mpfrnegzero mpfrnonum mpfrnr mpfrrem mpfrrnd mpfrrndeval mpfrsort mpfrsqrt \
mpfrstrtonum mpgforcenum mpfruplus mpfranswer42
@@ -5124,6 +5127,11 @@ mpfrcase:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+mpfrcase2:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
mpfrfield:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index 7fb3b3af..0b98f784 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -2241,6 +2241,11 @@ mpfrcase:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+mpfrcase2:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
mpfrfield:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/mpfrcase2.awk b/test/mpfrcase2.awk
new file mode 100644
index 00000000..52924486
--- /dev/null
+++ b/test/mpfrcase2.awk
@@ -0,0 +1,19 @@
+{
+ for (i = 1; i <= NF; i++) {
+ switch ($i) {
+ case "+" : case "-" :
+ case "*" : case "/" :
+ case "%" : case "^" :
+ printf $i; break
+ case /[a-z]/ :
+ printf $i; break
+ case /[0-9]/ :
+ printf $i; break
+ case /[ \t]/ :
+ printf $i; break
+ default :
+ print " wrong character " i " th: " $i
+ }
+ }
+ print ""
+}
diff --git a/test/mpfrcase2.in b/test/mpfrcase2.in
new file mode 100644
index 00000000..6ad0de24
--- /dev/null
+++ b/test/mpfrcase2.in
@@ -0,0 +1 @@
+12+45
diff --git a/test/mpfrcase2.ok b/test/mpfrcase2.ok
new file mode 100644
index 00000000..6ad0de24
--- /dev/null
+++ b/test/mpfrcase2.ok
@@ -0,0 +1 @@
+12+45