groff-commit
[Top][All Lists]
Advanced

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

[groff] 04/05: [mdoc]: Port a test to work with macOS sed.


From: G. Branden Robinson
Subject: [groff] 04/05: [mdoc]: Port a test to work with macOS sed.
Date: Mon, 13 Feb 2023 14:15:29 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit dd4511bfb08cd9b7ba8dae64eed32c9c5d57defe
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon Feb 13 11:58:40 2023 -0600

    [mdoc]: Port a test to work with macOS sed.
    
    * tmac/tests/doc_heading-font-remapping-works.sh: Put semicolons between
      commands and closing braces in sed script.  Put each of multiple
      closing braces on a separate input line, because macOS doesn't accept
      them otherwise.  Resolves test failure observed on macOS.
    
    * HACKING: Document the closing brace sequence problem.
    
    * ANNOUNCE: Drop notice of failing test case, now resolved.
---
 ANNOUNCE                                       |  1 -
 ChangeLog                                      | 11 +++++++++++
 HACKING                                        | 14 ++++++++++++--
 tmac/tests/doc_heading-font-remapping-works.sh |  7 ++++++-
 4 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/ANNOUNCE b/ANNOUNCE
index 704041334..e8a0a628f 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -146,7 +146,6 @@ o Some automated test failures (if you run "make check") 
are expected on
   for final release.  The following tests are affected.
 
        tmac/tests/an_use-input-traps-correctly.sh
-       tmac/tests/doc_heading-font-remapping-works.sh
        tmac/tests/latin2_works.sh
        tmac/tests/latin5_works.sh
        tmac/tests/latin9_works.sh
diff --git a/ChangeLog b/ChangeLog
index eba8cc1e3..c8e687cb1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2023-02-13  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [mdoc]: Port a test to work with macOS sed.
+
+       * tmac/tests/doc_heading-font-remapping-works.sh: Put semicolons
+       between commands and closing braces in sed script.  Put each of
+       multiple closing braces on a separate input line, because macOS
+       doesn't accept them otherwise.  Resolves test failure observed
+       on macOS.
+       * HACKING: Document the closing brace sequence problem.
+
 2023-02-13  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [man]: Port a test to work with macOS sed.
diff --git a/HACKING b/HACKING
index 9e1d8c07d..318f9f8fb 100644
--- a/HACKING
+++ b/HACKING
@@ -95,8 +95,8 @@ Here are some portability notes on writing automated tests.
     sed -n '/Foo\./{n;s/^$/FAILURE/;p;}'
 
 * POSIX doesn't say that sed has to accept semicolons as command
-  separators after label (':') and branch ('t') commands, so it doesn't.
-  GNU sed does.
+  separators after label (':') and branch ('t') commands, or after brace
+  commands, so it doesn't.  GNU sed does.
 
   So rewrite tidy, compact sed scripts like this:
     sed -n '/Foo\./{n;s/^$/FAILURE/;tA;s/.*/SUCCESS/;:A;p}'
@@ -105,3 +105,13 @@ Here are some portability notes on writing automated tests.
       -e '/Foo\./{n;s/^$/FAILURE/;tA;' \
       -e 's/.*/SUCCESS/;:A;' \
       -e 'p;}')
+
+  Similarly, a brace sequence like that in this partial sed script:
+    /f1/p}}}}}}
+  must be rewritten as follows.
+    /f1/p;}
+    }
+    }
+    }
+    }
+    }
diff --git a/tmac/tests/doc_heading-font-remapping-works.sh 
b/tmac/tests/doc_heading-font-remapping-works.sh
index 4fdd95acf..27f51964b 100755
--- a/tmac/tests/doc_heading-font-remapping-works.sh
+++ b/tmac/tests/doc_heading-font-remapping-works.sh
@@ -48,6 +48,11 @@ echo "$output" | sed -n '/tHacking/{n
 /h/{n
 /tgroff/{n
 /n/{n
-/f1/p}}}}}}' | grep -Fqx f1
+/f1/p;}
+}
+}
+}
+}
+}' | grep -Fqx f1
 
 # vim:set ai et sw=4 ts=4 tw=72:



reply via email to

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