Skip to content

Commit f28ad77

Browse files
committed
test/system: Unbreak the manual page checks with GNU roff >= 1.23
GNU roff 1.23 stopped remapping unescaped Hyphen-Minus (ie., - or 0x2D) characters in the input to Hyphen-Minus in the output. Instead, it follows the specified behaviour of converting unescaped Hyphen-Minus characters in the input to Hyphen (ie., ‐ or 0x2010) in the output. To get Hyphen-Minus characters in the output, one needs to escape the Hyphen-Minus with a backslash (ie., \-) in the input [1]. Therefore, the command line options documented in the manuals are no longer prefixed with the Hyphen-Minus character that's needed to ctually use them. This breaks copying and pasting from the manuals and searching within them. Unfortunately, escaping the Hyphen-Minus characters in Markdown doesn't have the intended effect of having Hyphen-Minus in the generated manual pages [2]. Therefore, this is worked around by having the tests check for both Hyphen-Minus and Hyphen. Note that some operating system distributions, like Debian, have reverted this change from GNU roff, but others haven't. So, unless it can be guaranteed that the manuals will always have Hyphen-Minus regardless of which GNU roff version or variant is being used, the tests need to check for both. [1] https://lwn.net/Articles/947941/ https://lists.gnu.org/archive/html/info-gnu/2023-07/msg00001.html https://git.savannah.gnu.org/cgit/groff.git/tree/PROBLEMS?h=1.23.0#n82 [2] cpuguy83/go-md2man#101 #1398
1 parent 651995e commit f28ad77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/system/002-help.bats

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ setup() {
4747
assert_success
4848
assert_line --index 0 --partial "toolbox(1)"
4949
assert_line --index 0 --partial "General Commands Manual"
50-
assert_line --index 3 --partial "toolbox - Tool for containerized command line environments on Linux"
50+
assert_line --index 3 --regexp "^[[:blank:]]+toolbox [‐-] Tool for containerized command line environments on Linux$"
5151
assert [ ${#lines[@]} -gt 4 ]
5252
assert [ ${#stderr_lines[@]} -eq 0 ]
5353
}
@@ -80,7 +80,7 @@ setup() {
8080
assert_success
8181
assert_line --index 0 --partial "toolbox(1)"
8282
assert_line --index 0 --partial "General Commands Manual"
83-
assert_line --index 3 --partial "toolbox - Tool for containerized command line environments on Linux"
83+
assert_line --index 3 --regexp "^[[:blank:]]+toolbox [‐-] Tool for containerized command line environments on Linux$"
8484
assert [ ${#lines[@]} -gt 4 ]
8585
assert [ ${#stderr_lines[@]} -eq 0 ]
8686
}

0 commit comments

Comments
 (0)