1#!/bin/sh
23
test_description='grep icase on non-English locales'
45
. ./lib-gettext.sh
67
test_expect_success GETTEXT_LOCALE 'setup' '
8test_write_lines "TILRAUN: Halló Heimur!" >file &&
9git add file &&
10LC_ALL="$is_IS_locale" &&
11export LC_ALL
12'
1314
test_have_prereq GETTEXT_LOCALE &&
15test-tool regex "HALLÓ" "Halló" ICASE &&
16test_set_prereq REGEX_LOCALE
1718
test_expect_success REGEX_LOCALE 'grep literal string, no -F' '
19git grep -i "TILRAUN: Halló Heimur!" &&
20git grep -i "TILRAUN: HALLÓ HEIMUR!"
21'
2223
test_expect_success GETTEXT_LOCALE,PCRE 'grep pcre utf-8 icase' '
24git grep --perl-regexp "TILRAUN: H.lló Heimur!" &&
25git grep --perl-regexp -i "TILRAUN: H.lló Heimur!" &&
26git grep --perl-regexp -i "TILRAUN: H.LLÓ HEIMUR!"
27'
2829
test_expect_success GETTEXT_LOCALE,PCRE 'grep pcre utf-8 string with "+"' '
30test_write_lines "TILRAUN: Hallóó Heimur!" >file2 &&
31git add file2 &&
32git grep -l --perl-regexp "TILRAUN: H.lló+ Heimur!" >actual &&
33echo file >expected &&
34echo file2 >>expected &&
35test_cmp expected actual
36'
3738
test_expect_success REGEX_LOCALE 'grep literal string, with -F' '
39git grep -i -F "TILRAUN: Halló Heimur!" &&
40git grep -i -F "TILRAUN: HALLÓ HEIMUR!"
41'
4243
test_expect_success REGEX_LOCALE 'grep string with regex, with -F' '
44test_write_lines "TILRAUN: Halló Heimur [abc]!" >file3 &&
45git add file3 &&
46git grep -i -F "TILRAUN: Halló Heimur [abc]!" file3
47'
4849
test_expect_success REGEX_LOCALE 'pickaxe -i on non-ascii' '
50git commit -m first &&
51git log --format=%f -i -S"TILRAUN: HALLÓ HEIMUR!" >actual &&
52echo first >expected &&
53test_cmp expected actual
54'
5556
test_done