All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX
@ 2012-03-05 19:39 Torsten Bögershausen
  2012-03-05 20:39 ` Junio C Hamano
  0 siblings, 1 reply; 25+ messages in thread
From: Torsten Bögershausen @ 2012-03-05 19:39 UTC (permalink / raw)
  To: git, avarab; +Cc: tboegi

t0204 tries to use a ISO-8859-1 locale and expects that characters
outside the ISO-8859-1 code range are converted in "question marks".

The gettext under Mac OS X ignores the ISO-8859-1 locale and uses
UTF-8 anyway.

Fixed even whitespace in this very test case.

Let the test pass when UTF-8 is returned.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
 This is a suggestion to make t0204--gettext-reencode-sanity.sh to pass under Mac OSX
 The tests checks if unicode characters outside ISO-8859-1 are converted into '?'.
 The Mac OS X version of gettext does not seem to support ISO-8859-1 at all.
 Even if we set the locale to ISO-8859-1, UTF-8 is used anyway.


 t/t0204-gettext-reencode-sanity.sh |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/t/t0204-gettext-reencode-sanity.sh b/t/t0204-gettext-reencode-sanity.sh
index 189af90..78f0889 100755
--- a/t/t0204-gettext-reencode-sanity.sh
+++ b/t/t0204-gettext-reencode-sanity.sh
@@ -27,16 +27,22 @@ 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 &&
+	LANGUAGE=is LC_ALL="$is_IS_iso_locale" gettext "TEST: Old English Runes" >runes &&
 
 	if grep "^TEST: Old English Runes$" runes
 	then
 		say "Your system can not handle this complexity and returns the string as-is"
 	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
+		if grep "^TILRAUN: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ" runes
+		then
+			# Mac OS supports only UTF-8, even if we want ISO-8859-1 we get UTF-8
+			say "Your system handles only utf-8"
+		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
+		fi
 	fi
 '
 
-- 
1.7.9.rc2

^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2012-03-13 19:33 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.