coreutils
[Top][All Lists]
Advanced

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

Re: new snapshot available: coreutils-8.15.74-be17e3


From: Jim Meyering
Subject: Re: new snapshot available: coreutils-8.15.74-be17e3
Date: Sun, 18 Mar 2012 13:38:35 +0100

Hi Bruno,

Bruno Haible wrote:
> [Removing platform-testers and the translation coordinator from the CC.]

Thanks.
I've adjusted my snapshot-announcement-creation script
to add a Mail-Followup-To: header, so that won't happen again.

> Paul Eggert wrote:
>> ... Bruno explained that this is a problem with the test cases,
>> not in the code:
>>
>> http://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00342.html
>>
>> As far as I know nobody has had the time to fix the test cases,
>> though.
>
> Here's a sketch of a proposal to fix the testsuite with minimal overhead
> (but still need to modify 85 files):
>
> - Add to init.sh a function comparemq() that converts Unicode quotation
>   marks to apostrophes in the ACTUAL argument.
>
> - Each time when comparing the output of a program against the expected
>   output, use 'comparemq' instead of 'compare'.
>
> I have verified that this fixes the problem for the 'rm/isatty' test.
>
>
> ==============================================================================
> --- tests/init.sh.bak 2012-02-03 10:22:06.000000000 +0100
> +++ tests/init.sh     2012-03-17 02:02:26.000000000 +0100
> @@ -311,6 +311,17 @@
>    esac
>  }
>
> +# Usage: comparemq EXPECTED ACTUAL
> +#
> +# Compares modulo quotation characters in UTF-8 encoding.
> +# EXPECTED contains apostrophes as quotes; ACTUAL may contain apostrophes
> +# or Unicode quotation marks as quotes.
> +comparemq ()
> +{
> +  sed -e "s/‘/'/g" -e "s/’/'/g" < "$2" > comparemq.tmp
> +  compare "$1" comparemq.tmp
> +}
> +
>  # An arbitrary prefix to help distinguish test directories.
>  testdir_prefix_ () { printf gt; }
>
> --- tests/rm/isatty.bak       2012-02-03 10:22:06.000000000 +0100
> +++ tests/rm/isatty   2012-03-17 01:56:43.000000000 +0100
> @@ -49,6 +49,6 @@
>  # Append an 'x' and a newline.
>  echo x >> out
>
> -compare exp out || fail=1
> +comparemq exp out || fail=1

Thanks for working on that.
I have read your explanations, but have to disagree: I think there
must be a way to tell the quoting code to print something ("'")
in a locale-independent manner.  I would have expected LC_ALL=C to
do that, so that the locale-aware quoting is turned off whenever
gettext is turned off.

In other words, it seems wrong (not to mention unmaintainable)
to have to use a separate comparison function for output that
contains quotes.  Besides, if some quoted string were to contain
a Unicode quotation mark, comparemq would mistakenly convert it.

For me, it is a fundamental requirement that there be be a way to
make our tools behave the same (as much as possible) on all systems.
Sure, the precise syntax of diagnostics is less of an issue than
what's printed on stdout or which options are accepted, but it is
important nonetheless.



reply via email to

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