summaryrefslogtreecommitdiff
path: root/HACKING
diff options
context:
space:
mode:
authorG. Branden Robinson <g.branden.robinson@gmail.com>2023-02-13 11:12:55 -0600
committerG. Branden Robinson <g.branden.robinson@gmail.com>2023-02-13 12:05:10 -0600
commit57e13c40ea472bc3276d0d630d2745e5e6a26744 (patch)
tree8d00664e32220b67399735144a95626c7a477b5c /HACKING
parent2ff76bc40468394c7aed3e0209880cd2c490c961 (diff)
downloadgroff-git-57e13c40ea472bc3276d0d630d2745e5e6a26744.tar.gz
[groff]: Accommodate macOS od behavior in test.
* src/roff/groff/tests/some_escapes_accept_newline_delimiters.sh: Weaken regexes in two test cases to accommodate excessive output from macOS's 'od' command. Resolves test failure seen on macOS. * HACKING: Add section "Writing Tests" and document the above since this is the second time I've cracked my shin on this. * ANNOUNCE: Drop notice of failing test case, now resolved.
Diffstat (limited to 'HACKING')
-rw-r--r--HACKING15
1 files changed, 15 insertions, 0 deletions
diff --git a/HACKING b/HACKING
index 22bee2312..58893fbc9 100644
--- a/HACKING
+++ b/HACKING
@@ -70,3 +70,18 @@ their impact.
contrast, adding a command-line option to tbl, or changing the
meaning of its "expand" region option such that it no longer
horizontally compresses tables as well, _would_ be 'NEWS'-worthy.
+
+
+Writing Tests
+-------------
+
+Here are some portability notes on writing automated tests.
+
+* The "od" command on macOS can put extra space characters (i.e., spaces
+ that don't correspond to the input) at the ends of lines when using
+ the "od -t c" format; GNU od does not.
+
+ So a regex like this that works with GNU od:
+ grep -Eqx '0000000 +A +\\b +B +\\b +C D +\\n'
+ might need to be weakened to the following on macOS.
+ grep -Eqx '0000000 +A +\\b +B +\\b +C D +\\n *'