gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] gawk branch, feature/bool, updated. gawk-4.1.0-4270-gedf26c6


From: Arnold Robbins
Subject: [SCM] gawk branch, feature/bool, updated. gawk-4.1.0-4270-gedf26c6
Date: Tue, 30 Mar 2021 08:27:17 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, feature/bool has been updated
       via  edf26c6ac2fa34280f1c5a9fe12e741ba1dc9e49 (commit)
      from  f021dfc21ac0a96270afbdcf9498b14e95619e6f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=edf26c6ac2fa34280f1c5a9fe12e741ba1dc9e49

commit edf26c6ac2fa34280f1c5a9fe12e741ba1dc9e49
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Tue Mar 30 15:26:58 2021 +0300

    Add asort with booleans test.

diff --git a/test/ChangeLog b/test/ChangeLog
index 2604c27..0212e1f 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2021-03-30         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * Makefile.am (EXTRA_DIST): asortbool, new test.
+       * asortbool.awk, asortbool.ok: New files.
+
 2021-03-08         Arnold D. Robbins     <arnold@skeeve.com>
 
        * dumpvars.ok, functab5.ok, id.ok, intest.awk, symtab11.ok,
diff --git a/test/Makefile.am b/test/Makefile.am
index bdb8831..0c56b7e 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -133,6 +133,8 @@ EXTRA_DIST = \
        assignnumfield.ok \
        assignnumfield2.awk \
        assignnumfield2.ok \
+       asortbool.awk \
+       asortbool.ok \
        awkpath.ok \
        back89.awk \
        back89.in \
@@ -1430,7 +1432,7 @@ UNIX_TESTS = \
 
 GAWK_EXT_TESTS = \
        aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort arraysort2 
\
-       arraytype \
+       arraytype asortbool \
        backw badargs beginfile1 beginfile2 binmode1 \
        charasbytes colonwarn clos1way clos1way2 clos1way3 clos1way4 clos1way5 \
        clos1way6 crlf \
diff --git a/test/Makefile.in b/test/Makefile.in
index 92ef9d0..fa823d0 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -396,6 +396,8 @@ EXTRA_DIST = \
        assignnumfield.ok \
        assignnumfield2.awk \
        assignnumfield2.ok \
+       asortbool.awk \
+       asortbool.ok \
        awkpath.ok \
        back89.awk \
        back89.in \
@@ -1693,7 +1695,7 @@ UNIX_TESTS = \
 
 GAWK_EXT_TESTS = \
        aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort arraysort2 
\
-       arraytype \
+       arraytype asortbool \
        backw badargs beginfile1 beginfile2 binmode1 \
        charasbytes colonwarn clos1way clos1way2 clos1way3 clos1way4 clos1way5 \
        clos1way6 crlf \
@@ -4265,6 +4267,11 @@ arraytype:
        then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \
        else $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; fi
 
+asortbool:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: $$? 
>>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
 backw:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  < "$(srcdir)"/$@.in >_$@ 2>&1 || 
echo EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index 20ed4a7..d3c4a23 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1330,6 +1330,11 @@ arraytype:
        then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \
        else $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; fi
 
+asortbool:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: $$? 
>>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
 backw:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  < "$(srcdir)"/$@.in >_$@ 2>&1 || 
echo EXIT CODE: $$? >>_$@
diff --git a/test/asortbool.awk b/test/asortbool.awk
new file mode 100644
index 0000000..7f5a94f
--- /dev/null
+++ b/test/asortbool.awk
@@ -0,0 +1,19 @@
+BEGIN {
+       a[1] = "foo"
+       a[2] = -45
+       a[3] = 45
+       a[4][1] = 47
+       a[5] = bool(1)
+       a[6] = bool(0)
+
+       asort(a, b, "@val_type_asc")
+
+       j = length(b)
+       for (i = 1; i <= j; i++) {
+               printf("%d, %s: ", i, typeof(b[i]))
+               if (isarray(b[i]))
+                       print b[i][1]
+               else
+                       print b[i]
+       }
+}
diff --git a/test/asortbool.ok b/test/asortbool.ok
new file mode 100644
index 0000000..de08a77
--- /dev/null
+++ b/test/asortbool.ok
@@ -0,0 +1,6 @@
+1, bool: FALSE
+2, bool: TRUE
+3, number: -45
+4, number: 45
+5, string: foo
+6, array: 47

-----------------------------------------------------------------------

Summary of changes:
 test/ChangeLog     |  5 +++++
 test/Makefile.am   |  4 +++-
 test/Makefile.in   |  9 ++++++++-
 test/Maketests     |  5 +++++
 test/asortbool.awk | 19 +++++++++++++++++++
 test/asortbool.ok  |  6 ++++++
 6 files changed, 46 insertions(+), 2 deletions(-)
 create mode 100644 test/asortbool.awk
 create mode 100644 test/asortbool.ok


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]