]>
Commit | Line | Data |
---|---|---|
5c1ebcca NTND |
1 | #!/bin/sh |
2 | ||
3 | test_description='grep icase on non-English locales' | |
4 | ||
5 | . ./lib-gettext.sh | |
6 | ||
7 | test_expect_success GETTEXT_LOCALE 'setup' ' | |
8 | test_write_lines "TILRAUN: Halló Heimur!" >file && | |
9 | git add file && | |
10 | LC_ALL="$is_IS_locale" && | |
11 | export LC_ALL | |
12 | ' | |
13 | ||
14 | test_have_prereq GETTEXT_LOCALE && | |
15 | test-regex "HALLÓ" "Halló" ICASE && | |
16 | test_set_prereq REGEX_LOCALE | |
17 | ||
18 | test_expect_success REGEX_LOCALE 'grep literal string, no -F' ' | |
19 | git grep -i "TILRAUN: Halló Heimur!" && | |
20 | git grep -i "TILRAUN: HALLÓ HEIMUR!" | |
21 | ' | |
22 | ||
793dc676 NTND |
23 | test_expect_success REGEX_LOCALE 'grep literal string, with -F' ' |
24 | git grep --debug -i -F "TILRAUN: Halló Heimur!" 2>&1 >/dev/null | | |
25 | grep fixed >debug1 && | |
26 | test_write_lines "fixed TILRAUN: Halló Heimur!" >expect1 && | |
27 | test_cmp expect1 debug1 && | |
28 | ||
29 | git grep --debug -i -F "TILRAUN: HALLÓ HEIMUR!" 2>&1 >/dev/null | | |
30 | grep fixed >debug2 && | |
31 | test_write_lines "fixed TILRAUN: HALLÓ HEIMUR!" >expect2 && | |
32 | test_cmp expect2 debug2 | |
33 | ' | |
34 | ||
35 | test_expect_success REGEX_LOCALE 'grep string with regex, with -F' ' | |
36 | test_write_lines "^*TILR^AUN:.* \\Halló \$He[]imur!\$" >file && | |
37 | ||
38 | git grep --debug -i -F "^*TILR^AUN:.* \\Halló \$He[]imur!\$" 2>&1 >/dev/null | | |
39 | grep fixed >debug1 && | |
40 | test_write_lines "fixed \\^*TILR^AUN:\\.\\* \\\\Halló \$He\\[]imur!\\\$" >expect1 && | |
41 | test_cmp expect1 debug1 && | |
42 | ||
43 | git grep --debug -i -F "^*TILR^AUN:.* \\HALLÓ \$HE[]IMUR!\$" 2>&1 >/dev/null | | |
44 | grep fixed >debug2 && | |
45 | test_write_lines "fixed \\^*TILR^AUN:\\.\\* \\\\HALLÓ \$HE\\[]IMUR!\\\$" >expect2 && | |
46 | test_cmp expect2 debug2 | |
47 | ' | |
48 | ||
5c1ebcca | 49 | test_done |