diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2019-09-24 20:43:59 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2019-09-24 20:43:59 +0300 |
commit | 09efc00fdb6af9376c13db420930dd48e9b273d0 (patch) | |
tree | 6649e717231396d3450bd6ba52a3c7d9bc0c4f7e /test | |
parent | f66b9207538981ba223eae6dd22a84266dc4a9c8 (diff) | |
download | egawk-09efc00fdb6af9376c13db420930dd48e9b273d0.tar.gz egawk-09efc00fdb6af9376c13db420930dd48e9b273d0.tar.bz2 egawk-09efc00fdb6af9376c13db420930dd48e9b273d0.zip |
New test: mpfranswer42.
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 5 | ||||
-rw-r--r-- | test/Makefile.am | 9 | ||||
-rw-r--r-- | test/Makefile.in | 9 | ||||
-rw-r--r-- | test/mpfranswer42.awk | 18 | ||||
-rw-r--r-- | test/mpfranswer42.ok | 1 |
5 files changed, 40 insertions, 2 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 9b608be2..956a0ff8 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2019-09-24 Jürgen Kahrs Google <juergen.kahrs@googlemail.com> + + * Makefile.am (EXTRA_DISTS): New test, mpfranswer42. + * mpfranswer42.awk, mpfranswer42.ok: New files. + 2019-07-23 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (EXTRA_DISTS): Fix typos in filenames. diff --git a/test/Makefile.am b/test/Makefile.am index f16225d2..62767427 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -719,6 +719,8 @@ EXTRA_DIST = \ mpfrstrtonum.awk \ mpfrstrtonum.ok \ mpfruplus.ok \ + mpfranswer42.awk \ + mpfranswer42.ok \ mpgforcenum.awk \ mpgforcenum.ok \ mtchi18n.awk \ @@ -1423,7 +1425,7 @@ NEED_LINT_OLD = lintold # List of tests that must be run with -M NEED_MPFR = mpfrbigint mpfrbigint2 mpfrexprange mpfrfield mpfrieee mpfrmemok1 \ mpfrnegzero mpfrnr mpfrrem mpfrrnd mpfrrndeval mpfrsort mpfrsqrt \ - mpfrstrtonum mpgforcenum mpfruplus + mpfrstrtonum mpgforcenum mpfruplus mpfranswer42 # List of tests that need --non-decimal-data NEED_NONDEC = mpfrbigint2 nondec2 intarray forcenum @@ -2034,6 +2036,11 @@ mpfruplus: @$(AWK) -M -f "$(srcdir)"/uplus.awk > _$@ 2>&1 || echo EXIT CODE: $$? >> _$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +mpfranswer42: + @echo $@ + @$(AWK) -M -f "$(srcdir)"/mpfranswer42.awk > _$@ 2>&1 || echo EXIT CODE: $$? >> _$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + mpfrmemok1: @echo $@ @$(AWK) -p- -M -f "$(srcdir)"/$@.awk 2>&1 | sed 1d > _$@ || echo EXIT CODE: $$? >> _$@ diff --git a/test/Makefile.in b/test/Makefile.in index 4b10060a..f5450ff3 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -978,6 +978,8 @@ EXTRA_DIST = \ mpfrstrtonum.awk \ mpfrstrtonum.ok \ mpfruplus.ok \ + mpfranswer42.awk \ + mpfranswer42.ok \ mpgforcenum.awk \ mpgforcenum.ok \ mtchi18n.awk \ @@ -1680,7 +1682,7 @@ NEED_LINT_OLD = lintold # List of tests that must be run with -M NEED_MPFR = mpfrbigint mpfrbigint2 mpfrexprange mpfrfield mpfrieee mpfrmemok1 \ mpfrnegzero mpfrnr mpfrrem mpfrrnd mpfrrndeval mpfrsort mpfrsqrt \ - mpfrstrtonum mpgforcenum mpfruplus + mpfrstrtonum mpgforcenum mpfruplus mpfranswer42 # List of tests that need --non-decimal-data @@ -2483,6 +2485,11 @@ mpfruplus: @$(AWK) -M -f "$(srcdir)"/uplus.awk > _$@ 2>&1 || echo EXIT CODE: $$? >> _$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +mpfranswer42: + @echo $@ + @$(AWK) -M -f "$(srcdir)"/mpfranswer42.awk > _$@ 2>&1 || echo EXIT CODE: $$? >> _$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + mpfrmemok1: @echo $@ @$(AWK) -p- -M -f "$(srcdir)"/$@.awk 2>&1 | sed 1d > _$@ || echo EXIT CODE: $$? >> _$@ diff --git a/test/mpfranswer42.awk b/test/mpfranswer42.awk new file mode 100644 index 00000000..41ca6211 --- /dev/null +++ b/test/mpfranswer42.awk @@ -0,0 +1,18 @@ +# This test case adds some numbers and the answer is 42. +# It was written to honour the scientists who solved a longstanding +# problem that was made popular by Douglas Adams in his book +# The Hitchhiker's Guide to the Galaxy. +# https://en.wikipedia.org/wiki/42_(number)#The_Hitchhiker's_Guide_to_the_Galaxy +# In September 2019, the University of Bristol made a release +# about the solution they found: +# https://www.bristol.ac.uk/news/2019/september/sum-of-three-cubes-.html +# +# This test case uses GAWK's big numbers to reproduce the calculation. + +BEGIN { + x = -80538738812075974 + y = 80435758145817515 + z = 12602123297335631 + print x^3 + y^3 + z^3 +} + diff --git a/test/mpfranswer42.ok b/test/mpfranswer42.ok new file mode 100644 index 00000000..d81cc071 --- /dev/null +++ b/test/mpfranswer42.ok @@ -0,0 +1 @@ +42 |