groff-commit
[Top][All Lists]
Advanced

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

[groff] 02/07: [tests]: Test localization with `-m` option.


From: G. Branden Robinson
Subject: [groff] 02/07: [tests]: Test localization with `-m` option.
Date: Sat, 10 Jul 2021 04:04:02 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 3e9250fea4ab3e698cf7c2f903eaa4ed0fabf5c0
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Jul 9 03:40:04 2021 +1000

    [tests]: Test localization with `-m` option.
    
    * src/roff/groff/tests/initialization_is_quiet.sh:
    * src/roff/groff/tests/localization_works.sh: Rewrite test to use
      explicit macro file loading localization mechanism.
---
 ChangeLog                                       |  6 ++
 src/roff/groff/tests/initialization_is_quiet.sh |  4 +-
 src/roff/groff/tests/localization_works.sh      | 75 +++++++------------------
 3 files changed, 27 insertions(+), 58 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 63b511e..97859e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-07-09  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/groff/tests/initialization_is_quiet.sh:
+       * src/roff/groff/tests/localization_works.sh: Rewrite to use
+       explicit macro file loading localization mechanism.
+
 2021-07-06  Dave Kemper <saint.snit@gmail.com>
 
        * doc/groff.texi (Operators in Conditionals): Document CSTR #54
diff --git a/src/roff/groff/tests/initialization_is_quiet.sh 
b/src/roff/groff/tests/initialization_is_quiet.sh
index eb71713..c3ca6c0 100755
--- a/src/roff/groff/tests/initialization_is_quiet.sh
+++ b/src/roff/groff/tests/initialization_is_quiet.sh
@@ -31,8 +31,8 @@ for COMPAT in "" -C
 do
   for LOCALE in cs de en fr it ja sv zh
   do
-    echo "testing LANG=$LOCALE; COMPAT=\"$COMPAT\""
-    OUTPUT=$(LANG=$LOCALE "$groff" -ww "$COMPAT" < /dev/null 2>&1)
+    echo "testing \"-m $LOCALE\"; COMPAT=\"$COMPAT\""
+    OUTPUT=$("$groff" -ww -m $LOCALE "$COMPAT" < /dev/null 2>&1)
     test -z "$OUTPUT"
   done
 done
diff --git a/src/roff/groff/tests/localization_works.sh 
b/src/roff/groff/tests/localization_works.sh
index 7eec9d1..66eba55 100755
--- a/src/roff/groff/tests/localization_works.sh
+++ b/src/roff/groff/tests/localization_works.sh
@@ -22,77 +22,40 @@ groff="${abs_top_builddir:-.}/test-groff"
 
 set -e
 
-export LC_ALL LANG
-
 DOC='\*[locale]'
 
-# Test fallback/conflicting cases.
-
-echo "testing that LC_ALL= LANG= loads English localization" >&2
-LC_ALL=
-LANG=
-OUTPUT=$(echo "$DOC" | "$groff" -Tascii)
-echo "$OUTPUT" | grep -qx english
-
-echo "testing that LC_ALL=en_US loads English localization" >&2
-LC_ALL=en_US
-LANG=
-OUTPUT=$(echo "$DOC" | "$groff" -Tascii)
-echo "$OUTPUT" | grep -qx english
-
-echo "testing that LC_ALL=en_US LANG=fr_FR loads English localization" \
-  >&2
-LC_ALL=en_US
-LANG=fr_FR
-OUTPUT=$(echo "$DOC" | "$groff" -Tascii)
-echo "$OUTPUT" | grep -qx english
-
-# Test straightforward cases.
+#echo "testing default localization (English)" >&2
+#OUTPUT=$(echo "$DOC" | "$groff" -Tascii)
+#echo "$OUTPUT" | grep -qx english
 
-echo "testing that LC_ALL= LANG=cs_CZ loads Czech localization" >&2
-LC_ALL=
-LANG=cs_CZ
-OUTPUT=$(echo "$DOC" | "$groff" -Tascii)
+echo "testing Czech localization" >&2
+OUTPUT=$(echo "$DOC" | "$groff" -Tascii -m cs)
 echo "$OUTPUT" | grep -qx czech
 
-echo "testing that LC_ALL= LANG=de_DE loads German localization" >&2
-LC_ALL=
-LANG=de_DE
-OUTPUT=$(echo "$DOC" | "$groff" -Tascii)
+echo "testing German localization" >&2
+OUTPUT=$(echo "$DOC" | "$groff" -Tascii -m de)
 echo "$OUTPUT" | grep -qx german
 
-echo "testing that LC_ALL= LANG=en_US loads English localization" >&2
-LC_ALL=
-LANG=en_US
-OUTPUT=$(echo "$DOC" | "$groff" -Tascii)
+echo "testing English localization" >&2
+OUTPUT=$(echo "$DOC" | "$groff" -Tascii -m en)
 echo "$OUTPUT" | grep -qx english
 
-echo "testing that LC_ALL= LANG=fr_FR loads French localization" >&2
-LC_ALL=
-LANG=fr_FR
-OUTPUT=$(echo "$DOC" | "$groff" -Tascii)
+echo "testing French localization" >&2
+OUTPUT=$(echo "$DOC" | "$groff" -Tascii -m fr)
 echo "$OUTPUT" | grep -qx french
 
-echo "testing that LC_ALL= LANG=it_IT loads Italian localization" >&2
-LC_ALL=
-LANG=it_IT
-OUTPUT=$(echo "$DOC" | "$groff" -Tascii)
+echo "testing Italian localization" >&2
+OUTPUT=$(echo "$DOC" | "$groff" -Tascii -m it)
 echo "$OUTPUT" | grep -qx italian
 
-echo "testing that LC_ALL= LANG=ja_JP loads Japanese localization" >&2
-LC_ALL=
-LANG=ja_JP
-OUTPUT=$(echo "$DOC" | "$groff" -Tascii)
+echo "testing Japanese localization" >&2
+OUTPUT=$(echo "$DOC" | "$groff" -Tascii -m ja)
 echo "$OUTPUT" | grep -qx japanese
 
-echo "testing that LC_ALL= LANG=sv_SE loads Swedish localization" >&2
-LC_ALL=
-LANG=sv_SE
-OUTPUT=$(echo "$DOC" | "$groff" -Tascii)
+echo "testing Swedish localization" >&2
+OUTPUT=$(echo "$DOC" | "$groff" -Tascii -m sv)
 echo "$OUTPUT" | grep -qx swedish
 
-echo "testing that LC_ALL= LANG=zh_ZH loads Chinese localization" >&2
-LC_ALL=
-LANG=zh_ZH
-OUTPUT=$(echo "$DOC" | "$groff" -Tascii)
+echo "testing Chinese localization" >&2
+OUTPUT=$(echo "$DOC" | "$groff" -Tascii -m zh)
 echo "$OUTPUT" | grep -qx chinese



reply via email to

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