3 test_description
='test log with i18n features'
6 if ! test_have_prereq ICONV
; then
7 skip_all
='skipping i18n tests, iconv not available'
12 utf8_e
=$
(printf '\303\251')
13 latin1_e
=$
(printf '\351')
15 test_expect_success
'create commits in different encodings' '
23 git -c i18n.commitencoding=utf8 commit -F msg &&
30 git -c i18n.commitencoding=ISO-8859-1 commit -F msg
33 test_expect_success
'log --grep searches in log output encoding (utf8)' '
34 cat >expect <<-\EOF &&
38 git log --encoding=utf8 --format=%s --grep=$utf8_e >actual &&
39 test_cmp expect actual
42 test_expect_success
!MINGW
'log --grep searches in log output encoding (latin1)' '
43 cat >expect <<-\EOF &&
47 git log --encoding=ISO-8859-1 --format=%s --grep=$latin1_e >actual &&
48 test_cmp expect actual
51 test_expect_success
!MINGW
'log --grep does not find non-reencoded values (utf8)' '
53 git log --encoding=utf8 --format=%s --grep=$latin1_e >actual &&
54 test_cmp expect actual
57 test_expect_success
'log --grep does not find non-reencoded values (latin1)' '
59 git log --encoding=ISO-8859-1 --format=%s --grep=$utf8_e >actual &&
60 test_cmp expect actual