git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] t9129: Prevent test failure if no UTF-8 locale

From
Aapplehq <theappleman@gmail.com>
Date
Dec 6, 2008, 01:31 UTC
Message-ID
<20081206013152.GA6129@cumin>

Commit 16fc08e2d86dad152194829d21bc55b2ef0c8fb1 introduced a test that failed if the en_US.UTF-8 locale was not installed.

Make the test find a UTF-8 locale, and expect failure.
Signed-off-by: applehq <theappleman@gmail.com>
---
 t/t9129-git-svn-i18n-commitencoding.sh |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/t/t9129-git-svn-i18n-commitencoding.sh b/t/t9129-git-svn-i18n-commitencoding.sh
index 938b7fe..87ecdd0 100755
--- a/t/t9129-git-svn-i18n-commitencoding.sh
+++ b/t/t9129-git-svn-i18n-commitencoding.sh
@@ -15,8 +15,9 @@ compare_git_head_with () {
 }
 
 compare_svn_head_with () {
-	LC_ALL=en_US.UTF-8 svn log --limit 1 `git svn info --url` | \
-		sed -e 1,3d -e "/^-\{1,\}\$/d" >current &&
+	LC_ALL=`locale -a | grep -i utf | head -1` \
+		svn log --limit 1 `git svn info --url` | \
+			sed -e 1,3d -e "/^-\{1,\}\$/d" >current &&
 	test_cmp current "$1"
 }
 
@@ -60,7 +61,7 @@ do
 	'
 done
 
-test_expect_success 'ISO-8859-1 should match UTF-8 in svn' '
+test_expect_failure 'ISO-8859-1 should match UTF-8 in svn' '
 (
 	cd ISO-8859-1 &&
 	compare_svn_head_with "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
@@ -69,7 +70,7 @@ test_expect_success 'ISO-8859-1 should match UTF-8 in svn' '
 
 for H in EUCJP ISO-2022-JP
 do
-	test_expect_success '$H should match UTF-8 in svn' '
+	test_expect_failure '$H should match UTF-8 in svn' '
 	(
 		cd $H &&
 		compare_svn_head_with "$TEST_DIRECTORY"/t3900/2-UTF-8.txt
-- 
1.6.1.rc1.53.g455b
Next: Junio C Hamano
Message 1 of 2 in “t9129: Prevent test failure if no UTF-8 locale”
  1. t9129: Prevent test failure if no UTF-8 localeapplehq, Dec 6, 2008
  2. Junio C HamanoDec 6, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.