Skip to content

Commit 54bc13c

Browse files
committed
t8005: Nobody writes Russian in shift_jis
The second and third tests of this script expected that Russian strings are converted between ISO-8859-5 and Shift_JIS in the "blame --porcelain" format output correctly. Sure, many platforms may convert between such a combination, but that is only because one of the base character set of Shift_JIS, JIS X 0208, defines codepoints for Russian characters (among others); I do not think anybody uses Shift_JIS when seriously writing Russian, and it is perfectly understandable if iconv() libraries on some platforms fail converting between this combination, as it does not matter in reality. This patch changes the test to verify Japanese strings are converted correctly between EUC-JP and Shift_JIS in the same procedure. The point of the test is not about verifying the platform's iconv() library, but to see if "git blame" makes correct iconv() library calls when it should. We could instead use ISO-8859-5 and KOI8-R as the combination, because they are both meant to represent Russian, in order to make this test meaningful on more platforms, but we already use Shift_JIS vs EUC-JP combinations to test other programs in our test suite, so this combination is safer from the point of view of the portability. Besides, I do not read nor write Russian; sorry ;-) This change allows tests to pass on my (friend's) Solaris 5.11 box. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 422a82f commit 54bc13c

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed

t/t8005-blame-i18n.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ test_description='git blame encoding conversion'
44
. ./test-lib.sh
55

66
. "$TEST_DIRECTORY"/t8005/utf8.txt
7-
. "$TEST_DIRECTORY"/t8005/cp1251.txt
7+
. "$TEST_DIRECTORY"/t8005/euc-japan.txt
88
. "$TEST_DIRECTORY"/t8005/sjis.txt
99

1010
test_expect_success 'setup the repository' '
@@ -13,10 +13,10 @@ test_expect_success 'setup the repository' '
1313
git add file &&
1414
git commit --author "$UTF8_NAME <utf8@localhost>" -m "$UTF8_MSG" &&
1515
16-
echo "CP1251 LINE" >> file &&
16+
echo "EUC-JAPAN LINE" >> file &&
1717
git add file &&
18-
git config i18n.commitencoding cp1251 &&
19-
git commit --author "$CP1251_NAME <cp1251@localhost>" -m "$CP1251_MSG" &&
18+
git config i18n.commitencoding eucJP &&
19+
git commit --author "$EUC_JAPAN_NAME <euc-japan@localhost>" -m "$EUC_JAPAN_MSG" &&
2020
2121
echo "SJIS LINE" >> file &&
2222
git add file &&
@@ -41,17 +41,17 @@ test_expect_success \
4141
'
4242

4343
cat >expected <<EOF
44-
author $CP1251_NAME
45-
summary $CP1251_MSG
46-
author $CP1251_NAME
47-
summary $CP1251_MSG
48-
author $CP1251_NAME
49-
summary $CP1251_MSG
44+
author $EUC_JAPAN_NAME
45+
summary $EUC_JAPAN_MSG
46+
author $EUC_JAPAN_NAME
47+
summary $EUC_JAPAN_MSG
48+
author $EUC_JAPAN_NAME
49+
summary $EUC_JAPAN_MSG
5050
EOF
5151

5252
test_expect_success \
5353
'blame respects i18n.logoutputencoding' '
54-
git config i18n.logoutputencoding cp1251 &&
54+
git config i18n.logoutputencoding eucJP &&
5555
git blame --incremental file | \
5656
egrep "^(author|summary) " > actual &&
5757
test_cmp actual expected
@@ -76,8 +76,8 @@ test_expect_success \
7676
cat >expected <<EOF
7777
author $SJIS_NAME
7878
summary $SJIS_MSG
79-
author $CP1251_NAME
80-
summary $CP1251_MSG
79+
author $EUC_JAPAN_NAME
80+
summary $EUC_JAPAN_MSG
8181
author $UTF8_NAME
8282
summary $UTF8_MSG
8383
EOF

t/t8005/euc-japan.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
EUC_JAPAN_NAME="���� ��Ϻ"
2+
EUC_JAPAN_MSG="�֥졼��Υƥ��ȤǤ���"

t/t8005/sjis.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
SJIS_NAME="�I�r�p�~ �P�u�������r�y�� �R�y�t�������r"
2-
SJIS_MSG="�S�u�������r���u �������q���u�~�y�u"
1+
SJIS_NAME="�R�c ���Y"
2+
SJIS_MSG="�u���[���̃e�X�g�ł��B"

t/t8005/utf8.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
UTF8_NAME="Иван Петрович Сидоров"
2-
UTF8_MSG="Тестовое сообщение"
1+
UTF8_NAME="山田 太郎"
2+
UTF8_MSG="ブレームのテストです。"

0 commit comments

Comments
 (0)