99
match_function=$4
100
ls_files_args=$5
101
102
+ prereqs=EXPENSIVE_ON_WINDOWS
103
+ case "$pattern" in
104
+ *\\*)
105
+ prereqs="$prereqs,BSLASHPSPEC"
106
+ ;;
107
+ esac
108
+
109
match_stdout_stderr_cmp="
110
tr -d '\0' <actual.raw >actual &&
111
test_must_be_empty actual.err &&
115
then
116
if test -e .git/created_test_file
117
then
111
- test_expect_success EXPENSIVE_ON_WINDOWS "$match_function (via ls-files): match dies on '$pattern' '$text'" "
118
+ test_expect_success $prereqs "$match_function (via ls-files): match dies on '$pattern' '$text'" "
119
printf '%s' '$text' >expect &&
120
test_must_fail git$ls_files_args ls-files -z -- '$pattern'
121
"
122
else
116
- test_expect_failure EXPENSIVE_ON_WINDOWS "$match_function (via ls-files): match skip '$pattern' '$text'" 'false'
123
+ test_expect_failure $prereqs "$match_function (via ls-files): match skip '$pattern' '$text'" 'false'
124
fi
125
elif test "$match_expect" = 1
126
then
127
if test -e .git/created_test_file
128
then
122
- test_expect_success EXPENSIVE_ON_WINDOWS "$match_function (via ls-files): match '$pattern' '$text'" "
129
+ test_expect_success $prereqs "$match_function (via ls-files): match '$pattern' '$text'" "
130
printf '%s' '$text' >expect &&
131
git$ls_files_args ls-files -z -- '$pattern' >actual.raw 2>actual.err &&
132
$match_stdout_stderr_cmp
133
"
134
else
128
- test_expect_failure EXPENSIVE_ON_WINDOWS "$match_function (via ls-files): match skip '$pattern' '$text'" 'false'
135
+ test_expect_failure $prereqs "$match_function (via ls-files): match skip '$pattern' '$text'" 'false'
136
fi
137
elif test "$match_expect" = 0
138
then
139
if test -e .git/created_test_file
140
then
134
- test_expect_success EXPENSIVE_ON_WINDOWS "$match_function (via ls-files): no match '$pattern' '$text'" "
141
+ test_expect_success $prereqs "$match_function (via ls-files): no match '$pattern' '$text'" "
142
>expect &&
143
git$ls_files_args ls-files -z -- '$pattern' >actual.raw 2>actual.err &&
144
$match_stdout_stderr_cmp
145
"
146
else
140
- test_expect_failure EXPENSIVE_ON_WINDOWS "$match_function (via ls-files): no match skip '$pattern' '$text'" 'false'
147
+ test_expect_failure $prereqs "$match_function (via ls-files): no match skip '$pattern' '$text'" 'false'
148
fi
149
else
150
test_expect_success "PANIC: Test framework error. Unknown matches value $match_expect" 'false'