diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2021-12-08 14:07:00 -0500 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2021-12-08 14:07:00 -0500 |
commit | c4b80d4a006d3cbcce3aaca1c598a094de936f8b (patch) | |
tree | 0444a9dacd4482fc568fddd7a45834618d8eb841 /test | |
parent | 322381086cf947e540e454bd427c214b1eaf6ed1 (diff) | |
download | egawk-c4b80d4a006d3cbcce3aaca1c598a094de936f8b.tar.gz egawk-c4b80d4a006d3cbcce3aaca1c598a094de936f8b.tar.bz2 egawk-c4b80d4a006d3cbcce3aaca1c598a094de936f8b.zip |
Patch API to allow extensions to convert undefined variables to arrays, and add a test case.
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 8 | ||||
-rw-r--r-- | test/Makefile.am | 8 | ||||
-rw-r--r-- | test/Makefile.in | 8 | ||||
-rw-r--r-- | test/testext-mpfr.ok | 2 | ||||
-rw-r--r-- | test/testext.ok | 2 |
5 files changed, 24 insertions, 4 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 034cc63b..67637641 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,11 @@ +2021-12-08 Andrew J. Schorr <aschorr@telemetry-investments.com> + + * Makefile.am (testext): Change awk pattern to include functions in + testext.awk. + (diffout): If running MPFR tests and there's an mpfr.ok file, compare + to that instead of to the regular ok file. + * testext.ok, testext-mpfr.ok: Update for new test_array_create test. + 2021-12-07 Andrew J. Schorr <aschorr@telemetry-investments.com> * iolint.awk, iolint.ok: Reorder "cat" pipe/output file test to reduce diff --git a/test/Makefile.am b/test/Makefile.am index 10c5c812..f9cdfd40 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -2281,7 +2281,7 @@ inplace3bcomp:: testext:: @echo $@ - @-$(AWK) ' /^(@load|BEGIN)/,/^}/' "$(top_srcdir)"/extension/testext.c > testext.awk + @-$(AWK) ' /^(@load|BEGIN|function)/,/^}/' "$(top_srcdir)"/extension/testext.c > testext.awk @-$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-if echo "$$GAWK_TEST_ARGS" | egrep -e '-M|--bignum' > /dev/null; \ then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ testext.awk testexttmp.txt ; \ @@ -2518,7 +2518,11 @@ diffout: if [ "$$i" != "_*" ]; then \ echo ============== $$i ============= ; \ base=`echo $$i | sed 's/^_//'` ; \ - if [ -r $${base}.ok ]; then \ + if echo "$$GAWK_TEST_ARGS" | egrep -e '-M|--bignum' > /dev/null && [ -r $${base}-mpfr.ok ]; then \ + diff -u $${base}-mpfr.ok $$i ; \ + elif echo "$$GAWK_TEST_ARGS" | egrep -e '-M|--bignum' > /dev/null && [ -r "$(srcdir)"/$${base}-mpfr.ok ]; then \ + diff -u "$(srcdir)"/$${base}-mpfr.ok $$i ; \ + elif [ -r $${base}.ok ]; then \ diff -u $${base}.ok $$i ; \ else \ diff -u "$(srcdir)"/$${base}.ok $$i ; \ diff --git a/test/Makefile.in b/test/Makefile.in index 6144e749..a4d27586 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -2735,7 +2735,7 @@ inplace3bcomp:: testext:: @echo $@ - @-$(AWK) ' /^(@load|BEGIN)/,/^}/' "$(top_srcdir)"/extension/testext.c > testext.awk + @-$(AWK) ' /^(@load|BEGIN|function)/,/^}/' "$(top_srcdir)"/extension/testext.c > testext.awk @-$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-if echo "$$GAWK_TEST_ARGS" | egrep -e '-M|--bignum' > /dev/null; \ then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ testext.awk testexttmp.txt ; \ @@ -5345,7 +5345,11 @@ diffout: if [ "$$i" != "_*" ]; then \ echo ============== $$i ============= ; \ base=`echo $$i | sed 's/^_//'` ; \ - if [ -r $${base}.ok ]; then \ + if echo "$$GAWK_TEST_ARGS" | egrep -e '-M|--bignum' > /dev/null && [ -r $${base}-mpfr.ok ]; then \ + diff -u $${base}-mpfr.ok $$i ; \ + elif echo "$$GAWK_TEST_ARGS" | egrep -e '-M|--bignum' > /dev/null && [ -r "$(srcdir)"/$${base}-mpfr.ok ]; then \ + diff -u "$(srcdir)"/$${base}-mpfr.ok $$i ; \ + elif [ -r $${base}.ok ]; then \ diff -u $${base}.ok $$i ; \ else \ diff -u "$(srcdir)"/$${base}.ok $$i ; \ diff --git a/test/testext-mpfr.ok b/test/testext-mpfr.ok index 2c616c67..ec584216 100644 --- a/test/testext-mpfr.ok +++ b/test/testext-mpfr.ok @@ -48,6 +48,8 @@ test_array_param: argument is not undefined (1) test_array_param() returned 0 isarray(a_scalar) = 0 +test_array_create returned 1 +good: we have an array Initial value of LINT is 0 print_do_lint: lint = 0 print_do_lint() returned 1 diff --git a/test/testext.ok b/test/testext.ok index fbc3c263..1d058302 100644 --- a/test/testext.ok +++ b/test/testext.ok @@ -48,6 +48,8 @@ test_array_param: argument is not undefined (1) test_array_param() returned 0 isarray(a_scalar) = 0 +test_array_create returned 1 +good: we have an array Initial value of LINT is 0 print_do_lint: lint = 0 print_do_lint() returned 1 |