diff options
author | G. Branden Robinson <g.branden.robinson@gmail.com> | 2023-02-13 18:41:42 -0600 |
---|---|---|
committer | G. Branden Robinson <g.branden.robinson@gmail.com> | 2023-02-13 20:22:48 -0600 |
commit | 4392979e9d616aebd376f5aac69a08277b7820dc (patch) | |
tree | ab38c4284584fea78331329f3753ec99352b131a /tmac | |
parent | 27057ea197f108ba657cc2f8bc4546de6c479946 (diff) | |
download | groff-git-4392979e9d616aebd376f5aac69a08277b7820dc.tar.gz |
[tmac]: Work around macOS od (mis-)behavior.
* tmac/tests/latin2_works.sh:
* tmac/tests/latin5_works.sh:
* tmac/tests/latin9_works.sh: Port to work around macOS's apparently
POSIX non-conforming 'od' command. Use single-byte octal output
format instead of "character", and update test expectations
accordingly. Apparently gratuitously, macOS also puts more spaces
after the octal address field when using this output format.
* HACKING: Document, and elaborate upon, this problem.
Also distinguish identical test failure diagnostics.
ANNOUNCE: Remove caveat about automated test failures on macOS.
Diffstat (limited to 'tmac')
-rwxr-xr-x | tmac/tests/latin2_works.sh | 30 | ||||
-rwxr-xr-x | tmac/tests/latin5_works.sh | 6 | ||||
-rwxr-xr-x | tmac/tests/latin9_works.sh | 6 |
3 files changed, 22 insertions, 20 deletions
diff --git a/tmac/tests/latin2_works.sh b/tmac/tests/latin2_works.sh index 144fcfb41..0b1ac84b8 100755 --- a/tmac/tests/latin2_works.sh +++ b/tmac/tests/latin2_works.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2022 Free Software Foundation, Inc. +# Copyright (C) 2022-2023 Free Software Foundation, Inc. # # This file is part of groff. # @@ -43,30 +43,32 @@ input=$(\ ) output=$(printf "%s\n" "$input" | "$groff" -Tlatin1 -mlatin2 \ - | LC_ALL=C od -t c) + | LC_ALL=C od -t o1) +printf "%s\n" "$output" printf "$output" \ - | grep -Eq '^0000000 241 242 243 246 251 252 253 254 256 257 +' \ + | grep -Eq '^0000000 +241 242 243 246 251 252 253 254 256 257 +' \ || wail "in block 0xA0" printf "$output" \ - | grep -Eq '^0000000 .* 261 262 263 266 271$' \ - || wail "in block 0xB0" + | grep -Eq '^0000000 +.* 261 262 263 266 271$' \ + || wail "in block 0xB0 (address 0..017)" printf "$output" \ - | grep -Eq '^0000020 272 273 274 275 256 277 +' \ - || wail "in block 0xB0" + | grep -Eq '^0000020 +272 273 274 275 256 277 +' \ + || wail "in block 0xB0 (address 020..037)" printf "$output" \ - | grep -Eq '^0000020 .* 300 303 305 306 310 312 314 317 +$' \ + | grep -Eq '^0000020 +.* 300 303 305 306 310 312 314 317 040$' \ || wail "in block 0xC0" printf "$output" \ - | grep -Eq '^0000040 320 321 322 325 330 331 333 336 +' \ + | grep -Eq '^0000040 +320 321 322 325 330 331 333 336 +' \ || wail "in block 0xD0" printf "$output" \ - | grep -Eq '^0000040 .* 340 343 345 346 350 352 354$' \ - || wail "in block 0xE0" + | grep -Eq '^0000040 +.* 340 343 345 346 350 352 354$' \ + || wail "in block 0xE0 (address 040..057)" printf "$output" \ - | grep -Eq '^0000060 357 +' \ - || wail "in block 0xE0" + | grep -Eq '^0000060 +357 +' \ + || wail "in block 0xE0 (address 060..077)" printf "$output" \ - | grep -Eq '^0000060 .* 360 361 362 365 370 371 373 376 377 +$' \ + | grep -Eq \ + '^0000060 +.* 360 361 362 365 370 371 373 376 377( 012)+$' \ || wail "in block 0xF0" test -z "$fail" diff --git a/tmac/tests/latin5_works.sh b/tmac/tests/latin5_works.sh index eb33a9dbd..62e1c1111 100755 --- a/tmac/tests/latin5_works.sh +++ b/tmac/tests/latin5_works.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2022 Free Software Foundation, Inc. +# Copyright (C) 2022-2023 Free Software Foundation, Inc. # # This file is part of groff. # @@ -22,9 +22,9 @@ groff="${abs_top_builddir:-.}/test-groff" input=$(printf '\\[G ab]\\[g ab]\\[u0130]\\[.i]\\[S ac]\\[s ac]') output=$(printf "%s\n" "$input" | "$groff" -Tlatin1 -mlatin5 \ - | LC_ALL=C od -t c) + | LC_ALL=C od -t o1) printf "%s\n" "$output" printf "$output" \ - | grep -Eq '^0000000 320 360 335 375 336 376 +' + | grep -Eq '^0000000 +320 360 335 375 336 376 +' # vim:set ai et sw=4 ts=4 tw=72: diff --git a/tmac/tests/latin9_works.sh b/tmac/tests/latin9_works.sh index 828c31367..ca5e23b28 100755 --- a/tmac/tests/latin9_works.sh +++ b/tmac/tests/latin9_works.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2022 Free Software Foundation, Inc. +# Copyright (C) 2022-2023 Free Software Foundation, Inc. # # This file is part of groff. # @@ -22,9 +22,9 @@ groff="${abs_top_builddir:-.}/test-groff" input=$(printf '\\[Eu]\\[vS]\\[vs]\\[vZ]\\[vz]\\[OE]\\[oe]\\[:Y]\n') output=$(printf "%s\n" "$input" | "$groff" -Tlatin1 -mlatin9 \ - | LC_ALL=C od -t c) + | LC_ALL=C od -t o1) printf "%s\n" "$output" printf "$output" \ - | grep -Eq '^0000000 244 246 250 264 270 274 275 276 +' + | grep -Eq '^0000000 +244 246 250 264 270 274 275 276 +' # vim:set ai et sw=4 ts=4 tw=72: |