groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 03/04: [tests]: Add test for multi-lingual man(7) scenario.


From: G. Branden Robinson
Subject: [groff] 03/04: [tests]: Add test for multi-lingual man(7) scenario.
Date: Sat, 9 Apr 2022 14:19:17 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 9d558b9e0fa335bb42243bd343b8e6bca63a076a
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Apr 9 08:22:07 2022 +1000

    [tests]: Add test for multi-lingual man(7) scenario.
    
    * tmac/tests/localization-works.sh: Test two more cases.  Ensure that
      the 'trap bit' (hyphenation value 2, which has nothing to do with any
      language) is preserved when switching locales back from a CJK
      language, since those languages' modes unconditionally clear it.  We
      test Japanese and Chinese; we have no localization macro file for
      Korean at this time.
---
 ChangeLog                        | 11 +++++++++++
 tmac/tests/localization-works.sh | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 4c646d45..4fe9b94e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2022-04-09  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [tests]: Add test for multi-lingual man(7) scenario.
+
+       * tmac/tests/localization-works.sh: Test two more cases.  Ensure
+       that the 'trap bit' (hyphenation value 2, which has nothing to
+       do with any language) is preserved when switching locales back
+       from a CJK language, since those languages' modes
+       unconditionally clear it.  We test Japanese and Chinese; we have
+       no localization macro file for Korean at this time.
+
 2022-04-09  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [man]: Slightly refactor `an*abbreviate-inner-footer`.
diff --git a/tmac/tests/localization-works.sh b/tmac/tests/localization-works.sh
index de05823e..0463a118 100755
--- a/tmac/tests/localization-works.sh
+++ b/tmac/tests/localization-works.sh
@@ -152,6 +152,38 @@ output=$(echo "$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
 
+# Ensure that the 'trap bit' (hyphenation value 2, which has nothing to
+# do with any language) is preserved when switching locales back from a
+# CJK language, since those languages' modes unconditionally clear it.
+
+input='.TH foo 1 2022-04-09 "groff test suite"
+.SH 名前
+foo \- APT 用選択制御ファイル
+.mso en.tmac
+.TH bar 1 2022-04-09 "groff test suite"
+.SH Name
+bar \- three subjects walk into this
+.tm .hy=\\n[.hy]'
+
+output=$(echo "$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
+
+input='.TH foo 1 2022-04-09 "groff test suite"
+.SH 名称
+foo \- 解析 man 手册页的头部信息
+.mso en.tmac
+.TH bar 1 2022-04-09 "groff test suite"
+.SH Name
+bar \- three subjects walk into this
+.tm .hy=\\n[.hy]'
+
+output=$(echo "$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
+
 test -z "$fail"
 
 # vim:set ai et sw=4 ts=4 tw=72:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]