At 2022-04-23T11:37:54-0500, Branden Robinson wrote:
> Hi Bertrand,
> 
> Excellent to see you back!  Please excuse the GMail-compromised
> response, but I wanted to venture a guess about the test failures
> you're seeing, in hopes I can hasten the problem toward resolution.

Hello again, Bertrand.  I'm back in the saddle.  Let me iterate my
thanks to you for grappling submodule and build system issues.

I'll note in case anyone had a problem with an 'M' descriptor showing up
next to the gnulib directory on "git status" output--I had to do a
  $ git submodule update
to resync with the update to the new gnulib tag.

After that things worked fine.

> > I had a little bit of time to test; I see 3 fails (I'm testing on
> > Archlinux) that block the release:
> >
> >    FAIL: tmac/tests/e_chapter-titles-work.sh
> >    FAIL: tmac/tests/e_ld-works.sh
> >    FAIL: tmac/tests/localization-works.sh
[...]
> Something all 3 of these tests have in common is that they populate a
> shell variable with embedded multiple backslashes, then pass that
> variable (double-quoted) as an argument to 'echo'.
> 
> It might be necessary to use printf(1) here instead.

Please try the attached patch.  It doesn't regress on my system, and if
it clears the problems on yours it should be good for a commit (if I add
a ChangeLog message).

Regards,
Branden
diff --git a/tmac/tests/e_chapter-titles-work.sh b/tmac/tests/e_chapter-titles-work.sh
index 949796871..3c7c6c1d5 100755
--- a/tmac/tests/e_chapter-titles-work.sh
+++ b/tmac/tests/e_chapter-titles-work.sh
@@ -24,7 +24,7 @@ groff="${abs_top_builddir:-.}/test-groff"
 # localization rigamarole.
 
 input='.de $C
-.  tm $C: \\\\$@
+.  tm $C: \\$@
 ..
 .++ C
 .+c "The Boy Sickens"
@@ -39,7 +39,7 @@ wail () {
     fail=YES
 }
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -me 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -me 2>&1)
 
 echo "checking for correct arguments given to \$C hook macro (1)" >&2
 echo "$output" | grep -Fqx '$C: "Chapter" "1" "The Boy Sickens"' || wail
diff --git a/tmac/tests/e_ld-works.sh b/tmac/tests/e_ld-works.sh
index 70ff97a33..1c315a857 100755
--- a/tmac/tests/e_ld-works.sh
+++ b/tmac/tests/e_ld-works.sh
@@ -30,7 +30,7 @@ input='.nr yr 108
 .++ C
 .+c "Fleeing the Impoverished, Drunken Countryside for Dublin"
 .pp
-The day was \\*(dw, \\*(td.
+The day was \*(dw, \*(td.
 .++ A
 .+c "How to Write for The Toast"
 .pp
@@ -43,12 +43,12 @@ wail () {
     fail=YES
 }
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -me)
-output_cs=$(echo "$input" | "$groff" -Tutf8 -P-cbou -me -mcs)
-output_de=$(echo "$input" | "$groff" -Tutf8 -P-cbou -me -mde)
-output_fr=$(echo "$input" | "$groff" -Tutf8 -P-cbou -me -mfr)
-output_it=$(echo "$input" | "$groff" -Tutf8 -P-cbou -me -mit)
-output_sv=$(echo "$input" | "$groff" -Tutf8 -P-cbou -me -msv)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -me)
+output_cs=$(printf "%s\n" "$input" | "$groff" -Tutf8 -P-cbou -me -mcs)
+output_de=$(printf "%s\n" "$input" | "$groff" -Tutf8 -P-cbou -me -mde)
+output_fr=$(printf "%s\n" "$input" | "$groff" -Tutf8 -P-cbou -me -mfr)
+output_it=$(printf "%s\n" "$input" | "$groff" -Tutf8 -P-cbou -me -mit)
+output_sv=$(printf "%s\n" "$input" | "$groff" -Tutf8 -P-cbou -me -msv)
 
 echo 'checking that `td` string updated correctly for English' >&2
 echo "$output" | grep -q 'The day was Monday, December 15, 2008\.$' \
diff --git a/tmac/tests/localization-works.sh b/tmac/tests/localization-works.sh
index 0463a118d..d80701804 100755
--- a/tmac/tests/localization-works.sh
+++ b/tmac/tests/localization-works.sh
@@ -27,128 +27,128 @@ wail () {
     fail=YES
 }
 
-input='.tm .hy=\\n[.hy]'
+input='.tm .hy=\n[.hy]'
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -mcs 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -mcs 2>&1)
 echo 'checking raw troff with -mcs' >&2
 echo "$output" | grep -Fqx '.hy=1' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -mde 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -mde 2>&1)
 echo 'checking raw troff with -mde' >&2
 echo "$output" | grep -Fqx '.hy=1' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -men 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -men 2>&1)
 echo 'checking raw troff with -men' >&2
 echo "$output" | grep -Fqx '.hy=4' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -mfr 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -mfr 2>&1)
 echo 'checking raw troff with -mfr' >&2
 echo "$output" | grep -Fqx '.hy=4' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -mit 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -mit 2>&1)
 echo 'checking raw troff with -mit' >&2
 echo "$output" | grep -Fqx '.hy=1' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -msv 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -msv 2>&1)
 echo 'checking raw troff with -msv' >&2
 echo "$output" | grep -Fqx '.hy=32' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -me -mcs 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -me -mcs 2>&1)
 echo 'checking -me with -mcs' >&2
 echo "$output" | grep -Fqx '.hy=2' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -me -mde 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -me -mde 2>&1)
 echo 'checking -me with -mde' >&2
 echo "$output" | grep -Fqx '.hy=2' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -me -men 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -me -men 2>&1)
 echo 'checking -me with -men' >&2
 echo "$output" | grep -Fqx '.hy=6' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -me -mfr 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -me -mfr 2>&1)
 echo 'checking -me with -mfr' >&2
 echo "$output" | grep -Fqx '.hy=6' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -me -mit 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -me -mit 2>&1)
 echo 'checking -me with -mit' >&2
 echo "$output" | grep -Fqx '.hy=2' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -me -msv 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -me -msv 2>&1)
 echo 'checking -me with -msv' >&2
 echo "$output" | grep -Fqx '.hy=34' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -ms -mcs 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -ms -mcs 2>&1)
 echo 'checking -ms with -mcs' >&2
 echo "$output" | grep -Fqx '.hy=2' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -ms -mde 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -ms -mde 2>&1)
 echo 'checking -ms with -mde' >&2
 echo "$output" | grep -Fqx '.hy=2' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -ms -men 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -ms -men 2>&1)
 echo 'checking -ms with -men' >&2
 echo "$output" | grep -Fqx '.hy=6' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -ms -mfr 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -ms -mfr 2>&1)
 echo 'checking -ms with -mfr' >&2
 echo "$output" | grep -Fqx '.hy=6' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -ms -mit 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -ms -mit 2>&1)
 echo 'checking -ms with -mit' >&2
 echo "$output" | grep -Fqx '.hy=2' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -ms -msv 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -ms -msv 2>&1)
 echo 'checking -ms with -msv' >&2
 echo "$output" | grep -Fqx '.hy=34' || wail
 
 input='.TH foo 1 2022-01-06 "groff test suite"
-.tm .hy=\\n[.hy]'
+.tm .hy=\n[.hy]'
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -rcR=0 -man -mcs 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -rcR=0 -man -mcs 2>&1)
 echo 'checking -man with -rcR=0 -mcs' >&2
 echo "$output" | grep -Fqx '.hy=2' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -rcR=0 -man -mde 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -rcR=0 -man -mde 2>&1)
 echo 'checking -man with -rcR=0 -mde' >&2
 echo "$output" | grep -Fqx '.hy=2' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -rcR=0 -man -men 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -rcR=0 -man -men 2>&1)
 echo 'checking -man with -rcR=0 -men' >&2
 echo "$output" | grep -Fqx '.hy=6' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -rcR=0 -man -mfr 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -rcR=0 -man -mfr 2>&1)
 echo 'checking -man with -rcR=0 -mfr' >&2
 echo "$output" | grep -Fqx '.hy=6' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -rcR=0 -man -mit 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -rcR=0 -man -mit 2>&1)
 echo 'checking -man with -rcR=0 -mit' >&2
 echo "$output" | grep -Fqx '.hy=2' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -rcR=0 -man -msv 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -rcR=0 -man -msv 2>&1)
 echo 'checking -man with -rcR=0 -msv' >&2
 echo "$output" | grep -Fqx '.hy=34' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -rcR=1 -man -mcs 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -rcR=1 -man -mcs 2>&1)
 echo 'checking -man with -rcR=1 -mcs' >&2
 echo "$output" | grep -Fqx '.hy=1' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -rcR=1 -man -mde 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -rcR=1 -man -mde 2>&1)
 echo 'checking -man with -rcR=1 -mde' >&2
 echo "$output" | grep -Fqx '.hy=1' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -rcR=1 -man -men 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -rcR=1 -man -men 2>&1)
 echo 'checking -man with -rcR=1 -men' >&2
 echo "$output" | grep -Fqx '.hy=4' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -rcR=1 -man -mfr 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -rcR=1 -man -mfr 2>&1)
 echo 'checking -man with -rcR=1 -mfr' >&2
 echo "$output" | grep -Fqx '.hy=4' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -rcR=1 -man -mit 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -rcR=1 -man -mit 2>&1)
 echo 'checking -man with -rcR=1 -mit' >&2
 echo "$output" | grep -Fqx '.hy=1' || wail
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -rcR=1 -man -msv 2>&1)
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -rcR=1 -man -msv 2>&1)
 echo 'checking -man with -rcR=1 -msv' >&2
 echo "$output" | grep -Fqx '.hy=32' || wail
 
@@ -163,9 +163,9 @@ foo \- APT 用選択制御ファイル
 .TH bar 1 2022-04-09 "groff test suite"
 .SH Name
 bar \- three subjects walk into this
-.tm .hy=\\n[.hy]'
+.tm .hy=\n[.hy]'
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -rcR=0 -man -mja \
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -rcR=0 -man -mja \
   -men 2>&1)
 echo 'checking -man with -rcR=0 -mja -men' >&2
 echo "$output" | grep -Fqx '.hy=6' || wail
@@ -177,9 +177,9 @@ foo \- 解析 man 手册页的头部信息
 .TH bar 1 2022-04-09 "groff test suite"
 .SH Name
 bar \- three subjects walk into this
-.tm .hy=\\n[.hy]'
+.tm .hy=\n[.hy]'
 
-output=$(echo "$input" | "$groff" -Tascii -P-cbou -rcR=0 -man -mzh \
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -rcR=0 -man -mzh \
   -men 2>&1)
 echo 'checking -man with -rcR=0 -mzh -men' >&2
 echo "$output" | grep -Fqx '.hy=6' || wail

Attachment: signature.asc
Description: PGP signature

Reply via email to