Hi Branden,
> Feedback welcome.
...
> +input='.pl 18v
> +.LP
> +The first page is \n%.
> +.DS
> +display
> +.DE
> +.bp
> +.LP
> +The second page is \n%.
> +.pl \n(nlu'
> +
> +output=$(printf '%s\n' "$input" | "$groff" -Tascii -P-cbou -ms)
> +echo "$output"
> +echo "$output" | grep -Fqx 'The second page is 2.'
Would it be worth testing all of $output is exactly as expected?
This would widen what's being tested which may catch a future regression
outside the scope of this test, e.g. with .DS/.DE.
The downside is a deliberate change might ripple through more tests but
the fix-up should be straightforward and would preserve the wider
testing.
$output can be encoded if it's considered too long. These two are
equivalent:
output='
The first page is 1.
display
-2-
The second page is 2.'
output=\
',,,,,,The first page is 1.,, display,,,,,,,,,
,,, -2-,,,The second page is 2.
'
output=$(echo "$output" | tr , \\012)
--
Cheers, Ralph.