gawk-diffs
[Top][All Lists]
Advanced

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

[SCM] gawk branch, stable/printf-rework, updated. gawk-4.1.0-5487-gecf1b


From: Arnold Robbins
Subject: [SCM] gawk branch, stable/printf-rework, updated. gawk-4.1.0-5487-gecf1b719
Date: Thu, 27 Jun 2024 04:14:02 -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, stable/printf-rework has been updated
       via  ecf1b719040196b391d0aadae276036c893d97c4 (commit)
      from  e3de4360243b7842c849f26d9e9093b25a0fa1fa (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=ecf1b719040196b391d0aadae276036c893d97c4

commit ecf1b719040196b391d0aadae276036c893d97c4
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Thu Jun 27 11:13:37 2024 +0300

    Improvement in hsprint test.

diff --git a/test/ChangeLog b/test/ChangeLog
index 47ac9661..55c01121 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,9 @@
+2024-06-27         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * hsprint.awk: Add headers to output, fix printing of
+       format string.
+       * hsprint.ok: Updated.
+
 2024-06-13         Arnold D. Robbins     <arnold@skeeve.com>
 
        * Makefile.am (EXTRA_DIST): Add asortsymtab-mpfr.ok.
diff --git a/test/hsprint.awk b/test/hsprint.awk
index facc109d..471d9a89 100644
--- a/test/hsprint.awk
+++ b/test/hsprint.awk
@@ -10,62 +10,73 @@
 
 
 BEGIN {
-    zero = "0";
-    alt  = "#";
-    spc  = " ";
-    plus = "+";
-    just = "-";
-    value[0] = 45;
-    value[1] = 45;
-    value[2] = 45;
-    value[3] = 12.678;
-    value[4] = 12.678;
-    value[5] = 12.678;
-    value[6] = "zap";
-    value[7] = "*";
-    value[8] = -3.4567;
-    value[9] = -3.4567;
-    value[10]= -3.4567;
-    value[11]= -3.4567;
-    oper[0]  = "5d";
-    oper[1]  = "5o";
-    oper[2]  = "5x";
-    oper[3]  = "7.2f";
-    oper[4]  = "10.2e";
-    oper[5]  = "10.4g";
-    oper[6]  = "5s";
-    oper[7]  = "5c";
-    oper[8]  = "7.1G";
-    oper[9]  = "7.2f";
-    oper[10] = "10.2e";
-    oper[11] = "10.4g";
+    zero = "0"
+    alt  = "#"
+    spc  = " "
+    plus = "+"
+    just = "-"
+    value[0] = 45
+    value[1] = 45
+    value[2] = 45
+    value[3] = 12.678
+    value[4] = 12.678
+    value[5] = 12.678
+    value[6] = "zap"
+    value[7] = "*"
+    value[8] = -3.4567
+    value[9] = -3.4567
+    value[10]= -3.4567
+    value[11]= -3.4567
+    oper[0]  = "5d"
+    oper[1]  = "5o"
+    oper[2]  = "5x"
+    oper[3]  = "7.2f"
+    oper[4]  = "10.2e"
+    oper[5]  = "10.4g"
+    oper[6]  = "5s"
+    oper[7]  = "5c"
+    oper[8]  = "7.1G"
+    oper[9]  = "7.2f"
+    oper[10] = "10.2e"
+    oper[11] = "10.4g"
+
+    header_fmt[0] = "fl\\fmt|%5s|%5s|%5s|%7s|%10s|%10s|\n"
+    header_fmt[1] = "fl\\fmt|%5s|%5s|%7s|%7s|%10s|%10s|\n"
+    header_sep[0] = "------+-----+-----+-----+-------+----------+----------+\n"
+    header_sep[1] = 
"------+-----+-----+-------+-------+----------+----------+\n"
 
     
     for (r = 0; r < 12; r += 6) {
+       printf(header_fmt[int(r / 6)],
+                  oper[r], oper[r+1], oper[r+2], oper[r+3], oper[r+4], 
oper[r+5])
+       printf(header_sep[int(r / 6)])
        for (j = 2; j > 0; --j) {
            for (p = 2; p > 0; --p) {
                for (s = 2; s > 0; --s) {
                    for (a = 2; a > 0; --a) {
                        for (z = 2; z > 0; --z) {
                            fmt = "%" substr(just,j,1) substr(plus,p,1) \
-                             substr(spc,s,1) substr(alt,a,1) substr(zero,z,1);
+                             substr(spc,s,1) substr(alt,a,1) substr(zero,z,1)
                            fstr = sprintf(\
                                     "%6s|%s%s|%s%s|%s%s|%s%s|%s%s|%s%s|\n",
-                                          "%" fmt, 
+                                          # "%" fmt, 
+                                          fmt, 
                                           fmt, oper[r],
                                           fmt, oper[r+1],
                                           fmt, oper[r+2],
                                           fmt, oper[r+3],
                                           fmt, oper[r+4],
-                                          fmt, oper[r+5]);
+                                          fmt, oper[r+5])
+#                          xstr = fstr; sub("\n", " +++\n", xstr)
+#                          printf("%s", xstr)
                            printf(fstr, value[r],   value[r+1],
                                         value[r+2], value[r+3],
-                                        value[r+4], value[r+5]);
+                                        value[r+4], value[r+5])
                        }
                    }
                }
            }
        }
-       print "";
+       print ""
     }
 }
diff --git a/test/hsprint.ok b/test/hsprint.ok
index f0a9e9cb..bc68cf41 100644
--- a/test/hsprint.ok
+++ b/test/hsprint.ok
@@ -1,66 +1,70 @@
-    %|   45|   55|   2d|  12.68|  1.27e+01|     12.68|
-   %0|00045|00055|0002d|0012.68|001.27e+01|0000012.68|
-   %#|   45|  055| 0x2d|  12.68|  1.27e+01|     12.68|
-  %#0|00045|00055|0x02d|0012.68|001.27e+01|0000012.68|
-   % |   45|   55|   2d|  12.68|  1.27e+01|     12.68|
-  % 0| 0045|00055|0002d| 012.68| 01.27e+01| 000012.68|
-  % #|   45|  055| 0x2d|  12.68|  1.27e+01|     12.68|
- % #0| 0045|00055|0x02d| 012.68| 01.27e+01| 000012.68|
-   %+|  +45|   55|   2d| +12.68| +1.27e+01|    +12.68|
-  %+0|+0045|00055|0002d|+012.68|+01.27e+01|+000012.68|
-  %+#|  +45|  055| 0x2d| +12.68| +1.27e+01|    +12.68|
- %+#0|+0045|00055|0x02d|+012.68|+01.27e+01|+000012.68|
-  %+ |  +45|   55|   2d| +12.68| +1.27e+01|    +12.68|
- %+ 0|+0045|00055|0002d|+012.68|+01.27e+01|+000012.68|
- %+ #|  +45|  055| 0x2d| +12.68| +1.27e+01|    +12.68|
-%+ #0|+0045|00055|0x02d|+012.68|+01.27e+01|+000012.68|
-   %-|45   |55   |2d   |12.68  |1.27e+01  |12.68     |
-  %-0|45   |55   |2d   |12.68  |1.27e+01  |12.68     |
-  %-#|45   |055  |0x2d |12.68  |1.27e+01  |12.68     |
- %-#0|45   |055  |0x2d |12.68  |1.27e+01  |12.68     |
-  %- | 45  |55   |2d   | 12.68 | 1.27e+01 | 12.68    |
- %- 0| 45  |55   |2d   | 12.68 | 1.27e+01 | 12.68    |
- %- #| 45  |055  |0x2d | 12.68 | 1.27e+01 | 12.68    |
-%- #0| 45  |055  |0x2d | 12.68 | 1.27e+01 | 12.68    |
-  %-+|+45  |55   |2d   |+12.68 |+1.27e+01 |+12.68    |
- %-+0|+45  |55   |2d   |+12.68 |+1.27e+01 |+12.68    |
- %-+#|+45  |055  |0x2d |+12.68 |+1.27e+01 |+12.68    |
-%-+#0|+45  |055  |0x2d |+12.68 |+1.27e+01 |+12.68    |
- %-+ |+45  |55   |2d   |+12.68 |+1.27e+01 |+12.68    |
-%-+ 0|+45  |55   |2d   |+12.68 |+1.27e+01 |+12.68    |
-%-+ #|+45  |055  |0x2d |+12.68 |+1.27e+01 |+12.68    |
+fl\fmt|   5d|   5o|   5x|   7.2f|     10.2e|     10.4g|
+------+-----+-----+-----+-------+----------+----------+
+     %|   45|   55|   2d|  12.68|  1.27e+01|     12.68|
+    %0|00045|00055|0002d|0012.68|001.27e+01|0000012.68|
+    %#|   45|  055| 0x2d|  12.68|  1.27e+01|     12.68|
+   %#0|00045|00055|0x02d|0012.68|001.27e+01|0000012.68|
+    % |   45|   55|   2d|  12.68|  1.27e+01|     12.68|
+   % 0| 0045|00055|0002d| 012.68| 01.27e+01| 000012.68|
+   % #|   45|  055| 0x2d|  12.68|  1.27e+01|     12.68|
+  % #0| 0045|00055|0x02d| 012.68| 01.27e+01| 000012.68|
+    %+|  +45|   55|   2d| +12.68| +1.27e+01|    +12.68|
+   %+0|+0045|00055|0002d|+012.68|+01.27e+01|+000012.68|
+   %+#|  +45|  055| 0x2d| +12.68| +1.27e+01|    +12.68|
+  %+#0|+0045|00055|0x02d|+012.68|+01.27e+01|+000012.68|
+   %+ |  +45|   55|   2d| +12.68| +1.27e+01|    +12.68|
+  %+ 0|+0045|00055|0002d|+012.68|+01.27e+01|+000012.68|
+  %+ #|  +45|  055| 0x2d| +12.68| +1.27e+01|    +12.68|
+ %+ #0|+0045|00055|0x02d|+012.68|+01.27e+01|+000012.68|
+    %-|45   |55   |2d   |12.68  |1.27e+01  |12.68     |
+   %-0|45   |55   |2d   |12.68  |1.27e+01  |12.68     |
+   %-#|45   |055  |0x2d |12.68  |1.27e+01  |12.68     |
+  %-#0|45   |055  |0x2d |12.68  |1.27e+01  |12.68     |
+   %- | 45  |55   |2d   | 12.68 | 1.27e+01 | 12.68    |
+  %- 0| 45  |55   |2d   | 12.68 | 1.27e+01 | 12.68    |
+  %- #| 45  |055  |0x2d | 12.68 | 1.27e+01 | 12.68    |
+ %- #0| 45  |055  |0x2d | 12.68 | 1.27e+01 | 12.68    |
+   %-+|+45  |55   |2d   |+12.68 |+1.27e+01 |+12.68    |
+  %-+0|+45  |55   |2d   |+12.68 |+1.27e+01 |+12.68    |
+  %-+#|+45  |055  |0x2d |+12.68 |+1.27e+01 |+12.68    |
+ %-+#0|+45  |055  |0x2d |+12.68 |+1.27e+01 |+12.68    |
+  %-+ |+45  |55   |2d   |+12.68 |+1.27e+01 |+12.68    |
+ %-+ 0|+45  |55   |2d   |+12.68 |+1.27e+01 |+12.68    |
+ %-+ #|+45  |055  |0x2d |+12.68 |+1.27e+01 |+12.68    |
 %-+ #0|+45  |055  |0x2d |+12.68 |+1.27e+01 |+12.68    |
 
-    %|  zap|    *|     -3|  -3.46| -3.46e+00|    -3.457|
-   %0|  zap|    *|-000003|-003.46|-03.46e+00|-00003.457|
-   %#|  zap|    *|    -3.|  -3.46| -3.46e+00|    -3.457|
-  %#0|  zap|    *|-00003.|-003.46|-03.46e+00|-00003.457|
-   % |  zap|    *|     -3|  -3.46| -3.46e+00|    -3.457|
-  % 0|  zap|    *|-000003|-003.46|-03.46e+00|-00003.457|
-  % #|  zap|    *|    -3.|  -3.46| -3.46e+00|    -3.457|
- % #0|  zap|    *|-00003.|-003.46|-03.46e+00|-00003.457|
-   %+|  zap|    *|     -3|  -3.46| -3.46e+00|    -3.457|
-  %+0|  zap|    *|-000003|-003.46|-03.46e+00|-00003.457|
-  %+#|  zap|    *|    -3.|  -3.46| -3.46e+00|    -3.457|
- %+#0|  zap|    *|-00003.|-003.46|-03.46e+00|-00003.457|
-  %+ |  zap|    *|     -3|  -3.46| -3.46e+00|    -3.457|
- %+ 0|  zap|    *|-000003|-003.46|-03.46e+00|-00003.457|
- %+ #|  zap|    *|    -3.|  -3.46| -3.46e+00|    -3.457|
-%+ #0|  zap|    *|-00003.|-003.46|-03.46e+00|-00003.457|
-   %-|zap  |*    |-3     |-3.46  |-3.46e+00 |-3.457    |
-  %-0|zap  |*    |-3     |-3.46  |-3.46e+00 |-3.457    |
-  %-#|zap  |*    |-3.    |-3.46  |-3.46e+00 |-3.457    |
- %-#0|zap  |*    |-3.    |-3.46  |-3.46e+00 |-3.457    |
-  %- |zap  |*    |-3     |-3.46  |-3.46e+00 |-3.457    |
- %- 0|zap  |*    |-3     |-3.46  |-3.46e+00 |-3.457    |
- %- #|zap  |*    |-3.    |-3.46  |-3.46e+00 |-3.457    |
-%- #0|zap  |*    |-3.    |-3.46  |-3.46e+00 |-3.457    |
-  %-+|zap  |*    |-3     |-3.46  |-3.46e+00 |-3.457    |
- %-+0|zap  |*    |-3     |-3.46  |-3.46e+00 |-3.457    |
- %-+#|zap  |*    |-3.    |-3.46  |-3.46e+00 |-3.457    |
-%-+#0|zap  |*    |-3.    |-3.46  |-3.46e+00 |-3.457    |
- %-+ |zap  |*    |-3     |-3.46  |-3.46e+00 |-3.457    |
-%-+ 0|zap  |*    |-3     |-3.46  |-3.46e+00 |-3.457    |
-%-+ #|zap  |*    |-3.    |-3.46  |-3.46e+00 |-3.457    |
+fl\fmt|   5s|   5c|   7.1G|   7.2f|     10.2e|     10.4g|
+------+-----+-----+-------+-------+----------+----------+
+     %|  zap|    *|     -3|  -3.46| -3.46e+00|    -3.457|
+    %0|  zap|    *|-000003|-003.46|-03.46e+00|-00003.457|
+    %#|  zap|    *|    -3.|  -3.46| -3.46e+00|    -3.457|
+   %#0|  zap|    *|-00003.|-003.46|-03.46e+00|-00003.457|
+    % |  zap|    *|     -3|  -3.46| -3.46e+00|    -3.457|
+   % 0|  zap|    *|-000003|-003.46|-03.46e+00|-00003.457|
+   % #|  zap|    *|    -3.|  -3.46| -3.46e+00|    -3.457|
+  % #0|  zap|    *|-00003.|-003.46|-03.46e+00|-00003.457|
+    %+|  zap|    *|     -3|  -3.46| -3.46e+00|    -3.457|
+   %+0|  zap|    *|-000003|-003.46|-03.46e+00|-00003.457|
+   %+#|  zap|    *|    -3.|  -3.46| -3.46e+00|    -3.457|
+  %+#0|  zap|    *|-00003.|-003.46|-03.46e+00|-00003.457|
+   %+ |  zap|    *|     -3|  -3.46| -3.46e+00|    -3.457|
+  %+ 0|  zap|    *|-000003|-003.46|-03.46e+00|-00003.457|
+  %+ #|  zap|    *|    -3.|  -3.46| -3.46e+00|    -3.457|
+ %+ #0|  zap|    *|-00003.|-003.46|-03.46e+00|-00003.457|
+    %-|zap  |*    |-3     |-3.46  |-3.46e+00 |-3.457    |
+   %-0|zap  |*    |-3     |-3.46  |-3.46e+00 |-3.457    |
+   %-#|zap  |*    |-3.    |-3.46  |-3.46e+00 |-3.457    |
+  %-#0|zap  |*    |-3.    |-3.46  |-3.46e+00 |-3.457    |
+   %- |zap  |*    |-3     |-3.46  |-3.46e+00 |-3.457    |
+  %- 0|zap  |*    |-3     |-3.46  |-3.46e+00 |-3.457    |
+  %- #|zap  |*    |-3.    |-3.46  |-3.46e+00 |-3.457    |
+ %- #0|zap  |*    |-3.    |-3.46  |-3.46e+00 |-3.457    |
+   %-+|zap  |*    |-3     |-3.46  |-3.46e+00 |-3.457    |
+  %-+0|zap  |*    |-3     |-3.46  |-3.46e+00 |-3.457    |
+  %-+#|zap  |*    |-3.    |-3.46  |-3.46e+00 |-3.457    |
+ %-+#0|zap  |*    |-3.    |-3.46  |-3.46e+00 |-3.457    |
+  %-+ |zap  |*    |-3     |-3.46  |-3.46e+00 |-3.457    |
+ %-+ 0|zap  |*    |-3     |-3.46  |-3.46e+00 |-3.457    |
+ %-+ #|zap  |*    |-3.    |-3.46  |-3.46e+00 |-3.457    |
 %-+ #0|zap  |*    |-3.    |-3.46  |-3.46e+00 |-3.457    |
 

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

Summary of changes:
 test/ChangeLog   |   6 +++
 test/hsprint.awk |  79 +++++++++++++++++++---------------
 test/hsprint.ok  | 128 ++++++++++++++++++++++++++++---------------------------
 3 files changed, 117 insertions(+), 96 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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