t2028: fix minor error and issues in newly-added "worktree move" tests
[git.git] / t / perf / p7820-grep-engines.sh
blob62aba19e7609678795d632d402dfd047d61d60bb
1 #!/bin/sh
3 test_description="Comparison of git-grep's regex engines
5 Set GIT_PERF_7820_GREP_OPTS in the environment to pass options to
6 git-grep. Make sure to include a leading space,
7 e.g. GIT_PERF_7820_GREP_OPTS=' -i'. Some options to try:
9 -i
12 -vi
13 -vw
14 -viw
17 . ./perf-lib.sh
19 test_perf_large_repo
20 test_checkout_worktree
22 for pattern in \
23 'how.to' \
24 '^how to' \
25 '[how] to' \
26 '\(e.t[^ ]*\|v.ry\) rare' \
27 'm\(ú\|u\)lt.b\(æ\|y\)te'
29 for engine in basic extended perl
31 if test $engine != "basic"
32 then
33 # Poor man's basic -> extended converter.
34 pattern=$(echo "$pattern" | sed 's/\\//g')
36 if test $engine = "perl" && ! test_have_prereq PCRE
37 then
38 prereq="PCRE"
39 else
40 prereq=""
42 test_perf $prereq "$engine grep$GIT_PERF_7820_GREP_OPTS '$pattern'" "
43 git -c grep.patternType=$engine grep$GIT_PERF_7820_GREP_OPTS -- '$pattern' >'out.$engine' || :
45 done
47 test_expect_success "assert that all engines found the same for$GIT_PERF_7820_GREP_OPTS '$pattern'" '
48 test_cmp out.basic out.extended &&
49 if test_have_prereq PCRE
50 then
51 test_cmp out.basic out.perl
54 done
56 test_done