bug-groff
[Top][All Lists]
Advanced

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

[bug #59461] smoke-test_html_device.sh: make the test more independent o


From: Bjarni Ingi Gislason
Subject: [bug #59461] smoke-test_html_device.sh: make the test more independent of locale
Date: Fri, 13 Nov 2020 13:02:51 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

URL:
  <https://savannah.gnu.org/bugs/?59461>

                 Summary: smoke-test_html_device.sh: make the test more
independent of locale
                 Project: GNU troff
            Submitted by: bjarniig
            Submitted on: Fri 13 Nov 2020 06:02:49 PM UTC
                Category: Preprocessor html
                Severity: 3 - Normal
              Item Group: Test
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

src/roff/groff/tests/smoke-test_html_device.sh:
  make the test more independent of the locale charset (charmap).

  Only test "locale" for the existence of a UTF-8 locale on the
computer.
(This might even be irrelevant.)

  As the encoding of the input is known, use that information.

  That is, change the option '-k' to '-Kutf8' for UTF-8 input,
and remove it for ascii input.

  Add a test for latin1 input.

  This was tested with

"locale charmap": ISO-8859-1

  and

"locale -a":

C
C.UTF-8
icelandic
is_IS
is_IS.iso88591
is_IS.utf8
POSIX

  A test without any UTF-8 locale file on the computer is missing (test
without the "locale -a | ...").

###

  Script to test changes:


#!/bin/sh

set -e

groff=/usr/bin/groff 

# Check three forms of character transformation.
#

# We test compatibility-mode HTML output somewhat differently from the
# third test
# since preconv only emits groffish \[uXXXX] escapes for non-ASCII
# codepoints.

# 1)

echo "testing -C -Thtml with \"\('a\"" >&2
printf "\('a" | "$groff" -C -Thtml | grep -qx '<p>&aacute;</p>'

# 2)

echo "testing -C -Thtml with \"\('a\" as a latin1 code" >&2
printf "รก" | "$groff" -C -Thtml | grep -qx '<p>&aacute;</p>'

# 3)
# We possibly can't run this tests, if no file for a UTF-8 locale exists

locale -a | grep -F -q UTF-8 || exit 77 # skip

# dash's built-in printf doesn't support \x or \u escapes, so likely
# other shells don't either, and expecting one, that does, to be in the
# $PATH seems optimistic.  So use UTF-8 octal bytes directly.

echo "testing -Kutf8 -Thtml" >&2
printf '\303\241' | "$groff" -Kutf8 -Thtml | grep -qx '<p>&aacute;</p>'

## End of script





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59461>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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