summaryrefslogtreecommitdiff
path: root/tmac
diff options
context:
space:
mode:
authorG. Branden Robinson <g.branden.robinson@gmail.com>2023-02-13 11:39:11 -0600
committerG. Branden Robinson <g.branden.robinson@gmail.com>2023-02-13 12:06:09 -0600
commita47e8985205d6c564b66e0d780b5893dabc6c84d (patch)
tree66e1cd309debbe1895813ac3af83f0abc1986358 /tmac
parent57e13c40ea472bc3276d0d630d2745e5e6a26744 (diff)
downloadgroff-git-a47e8985205d6c564b66e0d780b5893dabc6c84d.tar.gz
[man]: Port a test to work with macOS sed.
* tmac/tests/an_TS-adds-no-vertical-space.sh: Put semicolons between commands and closing braces in sed script. Separate command stream into multiple '-e' expressions, breaking them after branch and label commands. Resolves test failure observed on macOS. * HACKING: Document the above problems. * ANNOUNCE: Drop notice of failing test case, now resolved.
Diffstat (limited to 'tmac')
-rwxr-xr-xtmac/tests/an_TS-adds-no-vertical-space.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/tmac/tests/an_TS-adds-no-vertical-space.sh b/tmac/tests/an_TS-adds-no-vertical-space.sh
index f35377e56..d6e790ac7 100755
--- a/tmac/tests/an_TS-adds-no-vertical-space.sh
+++ b/tmac/tests/an_TS-adds-no-vertical-space.sh
@@ -33,8 +33,15 @@ bar
# Bash strips out an empty line, but that's what we're looking for.
output=$(printf "%s" "$input" | "$groff" -t -man -Tascii \
- | sed -n '/Foo\./{n;s/^$/FAILURE/;tA;s/.*/SUCCESS/;:A;p}')
-
+ | sed -n \
+ -e '/Foo\./{n;s/^$/FAILURE/;tA;' \
+ -e 's/.*/SUCCESS/;:A;' \
+ -e 'p;}')
+ # Here's a tidier version accepted by GNU sed but rejected
+ # contemptuously by macOS sed. (POSIX doesn't say you _have_ to
+ # accept semicolons after label ':' and branch 't' commands, so it
+ # doesn't.)
+ # sed -n '/Foo\./{n;s/^$/FAILURE/;tA;s/.*/SUCCESS/;:A;p}'
test "$output" = SUCCESS
# vim:set ai et sw=4 ts=4 tw=72: