git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Torsten Bögershausen" <tboegi@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	git@vger.kernel.org, "Torsten Bögershausen" <tboegi@web.de>
Subject: Re: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX
Date: Thu, 08 Mar 2012 06:54:54 +0100	[thread overview]
Message-ID: <4F5849AE.1070807@web.de> (raw)
In-Reply-To: <7vd38okmp0.fsf@alter.siamese.dyndns.org>

On 08.03.12 00:36, Junio C Hamano wrote:
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> 
>> Having that information doesn't cost us a lot, in this case we can
>> just amend the test to assert that on OSX the output should be the
>> same as under the UTF-8 output.
> 
> Known modes of error behaviour are to show:
> 
>  - runs of "?", saying "I dunno";
> 
>  - the key used to query the message catalog ("TEST: Old English
>    Runes"), saying "I don't do i18n"; or
> 
>  - the raw value stored in the message catalog (runes in UTF-8).
> 
> and each makes sort-of sense in its own way.
> 
> I would be OK if the patch read like the attached, but I do not
> think treating the "show key" and "stuff with ?" case differently
> like the original code did makes any sense.
> 
> It may be better to clarify in the "say" comment that this test is
> not about finding if the user's system is *broken* but about seeing
> if the "undefined" behaviour upon user error is one that we
> recognize, though.
> 
>  t/t0204-gettext-reencode-sanity.sh |   21 +++++++++++++--------
>  1 file changed, 13 insertions(+), 8 deletions(-)
> 
> diff --git a/t/t0204-gettext-reencode-sanity.sh b/t/t0204-gettext-reencode-sanity.sh
> index 189af90..8911e93 100755
> --- a/t/t0204-gettext-reencode-sanity.sh
> +++ b/t/t0204-gettext-reencode-sanity.sh
> @@ -7,6 +7,7 @@ test_description="Gettext reencoding of our *.po/*.mo files works"
>  
>  . ./lib-gettext.sh
>  
> +RUNES="TILRAUN: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ"
>  
>  test_expect_success GETTEXT_LOCALE 'gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic' '
>      printf "TILRAUN: Halló Heimur!" >expect &&
> @@ -15,7 +16,7 @@ test_expect_success GETTEXT_LOCALE 'gettext: Emitting UTF-8 from our UTF-8 *.mo
>  '
>  
>  test_expect_success GETTEXT_LOCALE 'gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes' '
> -    printf "TILRAUN: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ" >expect &&
> +    printf "%s" "$RUNES" >expect &&
>      LANGUAGE=is LC_ALL="$is_IS_locale" gettext "TEST: Old English Runes" >actual &&
>      test_cmp expect actual
>  '
> @@ -28,15 +29,19 @@ test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1 from our UT
>  
>  test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes' '
>      LANGUAGE=is LC_ALL="$is_IS_iso_locale" gettext "TEST: Old English Runes" >runes &&
> -
> -	if grep "^TEST: Old English Runes$" runes
> +	runes=$(cat runes) &&
> +	if test "z$runes" = "zTEST: Old English Runes"
> +	then
> +		say "Your system gives back the key to message catalog for an impossible request"
> +	elif test "z$runes" = "zTILRAUN: ?? ???? ??? ?? ???? ?? ??? ????? ??????????? ??? ?? ????"
> +	then
> +		say "Your system replaces an impossible character with ?"
> + 	elif test "z$runes" = "z$RUNES"
>  	then
> -		say "Your system can not handle this complexity and returns the string as-is"
> +		say "Your system gives back the raw message for an impossible request"
>  	else
> -		# Both Solaris and GNU libintl will return this stream of
> -		# question marks, so it is s probably portable enough
> -		printf "TILRAUN: ?? ???? ??? ?? ???? ?? ??? ????? ??????????? ??? ?? ????" >runes-expect &&
> -		test_cmp runes-expect runes
> +		say "We error behaviour your system shows"
> +		false
>  	fi
>  '
>  
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

With that patch the t0204 test is passed.

(based on 1.7.10-rc0).

 And all the other tests passed as well.

/Torsten



Applying: Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX
/Users/tb/projects/git/git_git/.git/rebase-apply/patch:35: space before tab in indent.
        elif test "z$runes" = "z$RUNES"
warning: 1 line adds whitespace errors.
~/projects/git/git_git> cd t
~/projects/git/git_git/t> ./t0204-gettext-reencode-sanity.sh
# lib-gettext: No is_IS UTF-8 locale available
# lib-gettext: No is_IS ISO-8859-1 locale available
ok 1 # skip gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic (missing GETTEXT_LOCALE)
ok 2 # skip gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes (missing GETTEXT_LOCALE)
ok 3 # skip gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Icelandic (missing GETTEXT_ISO_LOCALE)
ok 4 # skip gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes (missing GETTEXT_ISO_LOCALE)
ok 5 # skip gettext: Fetching a UTF-8 msgid -> UTF-8 (missing GETTEXT_LOCALE)
ok 6 # skip gettext: Fetching a UTF-8 msgid -> ISO-8859-1 (missing GETTEXT_ISO_LOCALE)
ok 7 # skip gettext.c: git init UTF-8 -> UTF-8 (missing GETTEXT_LOCALE)
ok 8 # skip gettext.c: git init UTF-8 -> ISO-8859-1 (missing GETTEXT_ISO_LOCALE)
# passed all 8 test(s)
1..8

  parent reply	other threads:[~2012-03-08  5:55 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-05 19:39 [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX Torsten Bögershausen
2012-03-05 20:39 ` Junio C Hamano
2012-03-07 21:03   ` Ævar Arnfjörð Bjarmason
2012-03-07 21:34     ` Junio C Hamano
2012-03-07 21:43       ` Ævar Arnfjörð Bjarmason
2012-03-07 21:58         ` Junio C Hamano
2012-03-07 22:04           ` Ævar Arnfjörð Bjarmason
2012-03-07 23:36             ` Junio C Hamano
2012-03-07 23:42               ` Junio C Hamano
2012-03-08  5:54               ` Torsten Bögershausen [this message]
2012-03-08  7:23                 ` Johannes Sixt
2012-03-08  9:21                   ` Torsten Bögershausen
2012-03-08 12:07                     ` Torsten Bögershausen
2012-03-09 22:30               ` Re*: " Junio C Hamano
2012-03-10 22:28                 ` Torsten Bögershausen
2012-03-11  6:36                   ` Junio C Hamano
2012-03-11 15:11                   ` Torsten Bögershausen
2012-03-11 19:22                     ` Junio C Hamano
2012-03-11 21:10                       ` Torsten Bögershausen
2012-03-11 21:38                         ` Junio C Hamano
2012-03-12 20:58                           ` Torsten Bögershausen
2012-03-12 21:25                             ` Junio C Hamano
2012-03-13 19:19                               ` Torsten Bögershausen
2012-03-13 19:32                                 ` Junio C Hamano
2012-03-12  5:46                     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F5849AE.1070807@web.de \
    --to=tboegi@web.de \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).