mirror of
https://https.git.savannah.gnu.org/git/groff.git
synced 2026-01-26 07:37:53 +00:00
[ms]: Port a test to Solaris 11 sed.
* tmac/tests/s_TC-works-with-percent-in-custom-titles.sh: Put newlines after opening braces in sed scripts. macOS and GNU sed tolerate their absence, but this sed does not. * HACKING: Document this problem.
This commit is contained in:
parent
668a1b183b
commit
b2201256d1
@ -1,3 +1,12 @@
|
||||
2023-02-16 G. Branden Robinson <g.branden.robinson@gmail.com>
|
||||
|
||||
[ms]: Port a test to Solaris 11 sed.
|
||||
|
||||
* tmac/tests/s_TC-works-with-percent-in-custom-titles.sh: Put
|
||||
newlines after opening braces in sed scripts. macOS and GNU sed
|
||||
tolerate their absence, but this sed does not.
|
||||
* HACKING: Document this problem.
|
||||
|
||||
2023-02-16 G. Branden Robinson <g.branden.robinson@gmail.com>
|
||||
|
||||
* src/roff/groff/groff.am (groff_TESTS) [!USE_GROHTML]: Don't
|
||||
|
||||
18
HACKING
18
HACKING
@ -113,6 +113,8 @@ Here are some portability notes on writing automated tests.
|
||||
as follows.
|
||||
sed -n '/Foo\./{n;s/^$/FAILURE/;p;}'
|
||||
|
||||
But see below regarding the opening braces.
|
||||
|
||||
* POSIX doesn't say that sed has to accept semicolons as command
|
||||
separators after label (':') and branch ('t') commands, or after brace
|
||||
commands, so macOS sed doesn't. GNU sed does.
|
||||
@ -125,12 +127,26 @@ Here are some portability notes on writing automated tests.
|
||||
-e 's/.*/SUCCESS/;:A;' \
|
||||
-e 'p;}')
|
||||
|
||||
But see below regarding the opening braces.
|
||||
|
||||
Similarly, a brace sequence like that in this partial sed script:
|
||||
/f1/p}}}}}}
|
||||
must be rewritten as follows.
|
||||
must be rewritten as follows (or with '-e' expressions).
|
||||
/f1/p;}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
* macOS and GNU sed don't require newlines (or '-e' expression endings)
|
||||
after _opening_ braces, but Solaris 11 sed does.
|
||||
|
||||
So the sed script
|
||||
/i/{N;/Table of Contents/{N;/Foo[. ][. ]*1/p;};}
|
||||
must be rewritten as follows (or with '-e' expressions).
|
||||
/i/{
|
||||
N;/Table of Contents/{
|
||||
N;/Foo[. ][. ]*1/p;
|
||||
};
|
||||
}
|
||||
|
||||
@ -42,7 +42,11 @@ OUTPUT=$(echo "$EXAMPLE" | "$groff" -Tascii -P-cbou -ms)
|
||||
# test is the presence, adjacency, and ordering of non-blank lines.
|
||||
FILTERED_OUTPUT=$(echo "$OUTPUT" \
|
||||
| sed '/^$/d' \
|
||||
| sed -n '/i/{N;/Table of Contents/{N;/Foo[. ][. ]*1/p;};}')
|
||||
| sed -n '/i/{
|
||||
N;/Table of Contents/{
|
||||
N;/Foo[. ][. ]*1/p;
|
||||
};
|
||||
}')
|
||||
test -n "$FILTERED_OUTPUT"
|
||||
|
||||
# vim:set ai et sw=4 ts=4 tw=72:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user