git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
blob d07fa20f08511a26276e61f8c0a9b401c97fa95e 2080 bytes (raw)
name: t/t7812-grep-icase-non-ascii.sh 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
 
#!/bin/sh

test_description='grep icase on non-English locales'

. ./lib-gettext.sh

test_expect_success GETTEXT_LOCALE 'setup' '
	printf "TILRAUN: Halló Heimur!" >file &&
	git add file &&
	LC_ALL="$is_IS_locale" &&
	export LC_ALL
'

test_expect_success GETTEXT_LOCALE 'grep literal string, no -F' '
	git grep -i "TILRAUN: Halló Heimur!" &&
	git grep -i "TILRAUN: HALLÓ HEIMUR!"
'

test_expect_success GETTEXT_LOCALE,LIBPCRE 'grep pcre utf-8 icase' '
	git grep --perl-regexp    "TILRAUN: H.lló Heimur!" &&
	git grep --perl-regexp -i "TILRAUN: H.lló Heimur!" &&
	git grep --perl-regexp -i "TILRAUN: H.LLÓ HEIMUR!"
'

test_expect_success GETTEXT_LOCALE,LIBPCRE 'grep pcre utf-8 string with "+"' '
	printf "TILRAUN: Hallóó Heimur!" >file2 &&
	git add file2 &&
	git grep -l --perl-regexp "TILRAUN: H.lló+ Heimur!" >actual &&
	echo file >expected &&
	echo file2 >>expected &&
	test_cmp expected actual
'

test_expect_success GETTEXT_LOCALE 'grep literal string, with -F' '
	git grep --debug -i -F "TILRAUN: Halló Heimur!"  2>&1 >/dev/null |
		 grep fixed >debug1 &&
	echo "fixedTILRAUN: Halló Heimur!" >expect1 &&
	test_cmp expect1 debug1 &&

	git grep --debug -i -F "TILRAUN: HALLÓ HEIMUR!"  2>&1 >/dev/null |
		 grep fixed >debug2 &&
	echo "fixedTILRAUN: HALLÓ HEIMUR!" >expect2 &&
	test_cmp expect2 debug2
'

test_expect_success GETTEXT_LOCALE 'grep string with regex, with -F' '
	printf "^*TILR^AUN:.* \\Halló \$He[]imur!\$" >file &&

	git grep --debug -i -F "^*TILR^AUN:.* \\Halló \$He[]imur!\$" 2>&1 >/dev/null |
		 grep fixed >debug1 &&
	echo "fixed\\^*TILR^AUN:\\.\\* \\\\Halló \$He\\[]imur!\\\$" >expect1 &&
	test_cmp expect1 debug1 &&

	git grep --debug -i -F "^*TILR^AUN:.* \\HALLÓ \$HE[]IMUR!\$"  2>&1 >/dev/null |
		 grep fixed >debug2 &&
	echo "fixed\\^*TILR^AUN:\\.\\* \\\\HALLÓ \$HE\\[]IMUR!\\\$" >expect2 &&
	test_cmp expect2 debug2
'

test_expect_success GETTEXT_LOCALE 'pickaxe -i on non-ascii' '
	git commit -m first &&
	git log --format=%f -i -S"TILRAUN: HALLÓ HEIMUR!" >actual &&
	echo first >expected &&
	test_cmp expected actual
'

test_done

debug log:

solving d07fa20 ...
found d07fa20 in https://public-inbox.org/git/1436880280-18194-10-git-send-email-pclouds@gmail.com/
found e861a15 in https://public-inbox.org/git/1436880280-18194-8-git-send-email-pclouds@gmail.com/
found c945589 in https://public-inbox.org/git/1436351919-2520-5-git-send-email-pclouds@gmail.com/ ||
	https://public-inbox.org/git/1436880280-18194-5-git-send-email-pclouds@gmail.com/
found 63a2630 in https://public-inbox.org/git/1436351919-2520-4-git-send-email-pclouds@gmail.com/ ||
	https://public-inbox.org/git/1436880280-18194-4-git-send-email-pclouds@gmail.com/

applying [1/4] https://public-inbox.org/git/1436351919-2520-4-git-send-email-pclouds@gmail.com/
diff --git a/t/t7812-grep-icase-non-ascii.sh b/t/t7812-grep-icase-non-ascii.sh
new file mode 100755
index 0000000..63a2630

Checking patch t/t7812-grep-icase-non-ascii.sh...
Applied patch t/t7812-grep-icase-non-ascii.sh cleanly.

skipping https://public-inbox.org/git/1436880280-18194-4-git-send-email-pclouds@gmail.com/ for 63a2630
index at:
100755 63a26300f48c7fcf58f92aa6fbb6ebc49887a04b	t/t7812-grep-icase-non-ascii.sh

applying [2/4] https://public-inbox.org/git/1436351919-2520-5-git-send-email-pclouds@gmail.com/
diff --git a/t/t7812-grep-icase-non-ascii.sh b/t/t7812-grep-icase-non-ascii.sh
index 63a2630..c945589 100755

Checking patch t/t7812-grep-icase-non-ascii.sh...
Applied patch t/t7812-grep-icase-non-ascii.sh cleanly.

skipping https://public-inbox.org/git/1436880280-18194-5-git-send-email-pclouds@gmail.com/ for c945589
index at:
100755 c9455894ac4a671451d49536e23a517f6d738658	t/t7812-grep-icase-non-ascii.sh

applying [3/4] https://public-inbox.org/git/1436880280-18194-8-git-send-email-pclouds@gmail.com/
diff --git a/t/t7812-grep-icase-non-ascii.sh b/t/t7812-grep-icase-non-ascii.sh
index c945589..e861a15 100755


applying [4/4] https://public-inbox.org/git/1436880280-18194-10-git-send-email-pclouds@gmail.com/
diff --git a/t/t7812-grep-icase-non-ascii.sh b/t/t7812-grep-icase-non-ascii.sh
index e861a15..d07fa20 100755

Checking patch t/t7812-grep-icase-non-ascii.sh...
Applied patch t/t7812-grep-icase-non-ascii.sh cleanly.
Checking patch t/t7812-grep-icase-non-ascii.sh...
Applied patch t/t7812-grep-icase-non-ascii.sh cleanly.

index at:
100755 d07fa20f08511a26276e61f8c0a9b401c97fa95e	t/t7812-grep-icase-non-ascii.sh

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).