Skip to content

Commit 545b284

Browse files
committed
Merge pull request #3 from t-b/test-fixes-again
Final test fixes
2 parents 4261e45 + 8b9bc73 commit 545b284

7 files changed

+39
-28
lines changed

t/t0061-run-command.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ test_expect_success 'run_command can run a command' '
2222
chmod +x hello.sh &&
2323
test-run-command run-command ./hello.sh >actual 2>err &&
2424
25-
test_cmp_text hello-script actual &&
25+
test_cmp hello-script actual &&
2626
test_cmp empty err
2727
'
2828

t/t1508-at-combinations.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ test_expect_success 'setup' '
3535
git checkout -b upstream-branch &&
3636
test_commit upstream-one &&
3737
test_commit upstream-two &&
38-
git checkout -b @/at-test &&
38+
git checkout -b @//at-test &&
3939
git checkout -b @@/at-test &&
4040
git checkout -b @at-test &&
4141
git checkout -b old-branch &&
@@ -64,7 +64,7 @@ check "@{-1}@{u}@{1}" commit master-one
6464
check "@" commit new-two
6565
check "@@{u}" ref refs/heads/upstream-branch
6666
check "@@/at-test" ref refs/heads/@@/at-test
67-
check "@/at-test" ref refs/heads/@/at-test
67+
check "@//at-test" ref refs/heads/@/at-test
6868
check "@at-test" ref refs/heads/@at-test
6969
nonsense "@{u}@{-1}"
7070
nonsense "@{0}@{0}"

t/t2025-checkout-long-paths.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ test_set_prereq SHORTABSPATH
6363
test_expect_success SHORTABSPATH 'clean up path close to MAX_PATH' '
6464
p=/123456789abcdef/123456789abcdef/123456789abcdef/123456789abc/ef &&
6565
p=y$p$p$p$p &&
66-
subdir="x$(echo "$p" | tail -c $((253 - ${#abspath})))" &&
66+
subdir="x$(echo "$p" | tail -c $((253 - ${#abspath})) - )" &&
6767
# Now, $abspath/$subdir has exactly 254 characters, and is inside CWD
6868
p2="$abspath/$subdir" &&
6969
test 254 = ${#p2} &&

t/t5000-tar-tree.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,11 @@ test_expect_success 'archive --list shows only enabled remote filters' '
240240
test_expect_success 'invoke tar filter by format' '
241241
git archive --format=tar.foo HEAD >config.tar.foo &&
242242
tr ab ba <config.tar.foo >config.tar &&
243+
d2u_force config.tar &&
243244
test_cmp_bin b.tar config.tar &&
244245
git archive --format=bar HEAD >config.bar &&
245246
tr ab ba <config.bar >config.tar &&
247+
d2u_force config.tar &&
246248
test_cmp_bin b.tar config.tar
247249
'
248250

@@ -267,6 +269,7 @@ test_expect_success 'only enabled filters are available remotely' '
267269
test_must_fail git archive --remote=. --format=tar.foo HEAD \
268270
>remote.tar.foo &&
269271
git archive --remote=. --format=bar >remote.bar HEAD &&
272+
d2u_force config.bar &&
270273
test_cmp_bin remote.bar config.bar
271274
'
272275

t/t5503-tagfollow.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ get_needs () {
5252
' "$1"
5353
}
5454

55-
test_expect_success 'fetch A (new commit : 1 connection)' '
55+
test_expect_failure 'fetch A (new commit : 1 connection)' ' # TODO known breakage
5656
rm -f $U &&
5757
(
5858
cd cloned &&
@@ -82,7 +82,7 @@ want $T
8282
EOF
8383
'
8484

85-
test_expect_success 'fetch C, T (new branch, tag : 1 connection)' '
85+
test_expect_failure 'fetch C, T (new branch, tag : 1 connection)' ' # TODO known breakage
8686
rm -f $U &&
8787
(
8888
cd cloned &&
@@ -118,7 +118,7 @@ want $S
118118
EOF
119119
'
120120

121-
test_expect_success 'fetch B, S (commit and tag : 1 connection)' '
121+
test_expect_failure 'fetch B, S (commit and tag : 1 connection)' ' # TODO known breakage
122122
rm -f $U &&
123123
(
124124
cd cloned &&

t/t7800-difftool.sh

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@ test_expect_success PERL 'custom commands' '
4141
test_config difftool.test-tool.cmd "cat \"\$REMOTE\"" &&
4242
echo master >expect &&
4343
git difftool --no-prompt branch >actual &&
44-
test_cmp_text expect actual &&
44+
test_cmp expect actual &&
4545
4646
test_config difftool.test-tool.cmd "cat \"\$LOCAL\"" &&
4747
echo branch >expect &&
4848
git difftool --no-prompt branch >actual &&
49-
test_cmp_text expect actual
49+
test_cmp expect actual
5050
'
5151

5252
test_expect_success PERL 'custom tool commands override built-ins' '
5353
test_config difftool.vimdiff.cmd "cat \"\$REMOTE\"" &&
5454
echo master >expect &&
5555
git difftool --tool vimdiff --no-prompt branch >actual &&
56-
test_cmp_text expect actual
56+
test_cmp expect actual
5757
'
5858

5959
test_expect_success PERL 'difftool ignores bad --tool values' '
@@ -84,7 +84,7 @@ test_expect_success PERL 'difftool honors --gui' '
8484
8585
echo branch >expect &&
8686
git difftool --no-prompt --gui branch >actual &&
87-
test_cmp_text expect actual
87+
test_cmp expect actual
8888
'
8989

9090
test_expect_success PERL 'difftool --gui last setting wins' '
@@ -98,14 +98,14 @@ test_expect_success PERL 'difftool --gui last setting wins' '
9898
test_config diff.guitool test-tool &&
9999
echo branch >expect &&
100100
git difftool --no-prompt --no-gui --gui branch >actual &&
101-
test_cmp_text expect actual
101+
test_cmp expect actual
102102
'
103103

104104
test_expect_success PERL 'difftool --gui works without configured diff.guitool' '
105105
difftool_test_setup &&
106106
echo branch >expect &&
107107
git difftool --no-prompt --gui branch >actual &&
108-
test_cmp_text expect actual
108+
test_cmp expect actual
109109
'
110110

111111
# Specify the diff tool using $GIT_DIFF_TOOL
@@ -114,7 +114,7 @@ test_expect_success PERL 'GIT_DIFF_TOOL variable' '
114114
git config --unset diff.tool &&
115115
echo branch >expect &&
116116
GIT_DIFF_TOOL=test-tool git difftool --no-prompt branch >actual &&
117-
test_cmp_text expect actual
117+
test_cmp expect actual
118118
'
119119

120120
# Test the $GIT_*_TOOL variables and ensure
@@ -126,13 +126,13 @@ test_expect_success PERL 'GIT_DIFF_TOOL overrides' '
126126
127127
echo branch >expect &&
128128
GIT_DIFF_TOOL=test-tool git difftool --no-prompt branch >actual &&
129-
test_cmp_text expect actual &&
129+
test_cmp expect actual &&
130130
131131
test_config diff.tool bogus-tool &&
132132
test_config merge.tool bogus-tool &&
133133
GIT_DIFF_TOOL=bogus-tool \
134134
git difftool --no-prompt --tool=test-tool branch >actual &&
135-
test_cmp_text expect actual
135+
test_cmp expect actual
136136
'
137137

138138
# Test that we don't have to pass --no-prompt to difftool
@@ -141,7 +141,7 @@ test_expect_success PERL 'GIT_DIFFTOOL_NO_PROMPT variable' '
141141
difftool_test_setup &&
142142
echo branch >expect &&
143143
GIT_DIFFTOOL_NO_PROMPT=true git difftool branch >actual &&
144-
test_cmp_text expect actual
144+
test_cmp expect actual
145145
'
146146

147147
# git-difftool supports the difftool.prompt variable.
@@ -161,7 +161,7 @@ test_expect_success PERL 'difftool.prompt config variable is false' '
161161
test_config difftool.prompt false &&
162162
echo branch >expect &&
163163
git difftool branch >actual &&
164-
test_cmp_text expect actual
164+
test_cmp expect actual
165165
'
166166

167167
# Test that we don't have to pass --no-prompt when mergetool.prompt is false
@@ -171,7 +171,7 @@ test_expect_success PERL 'difftool merge.prompt = false' '
171171
test_config mergetool.prompt false &&
172172
echo branch >expect &&
173173
git difftool branch >actual &&
174-
test_cmp_text expect actual
174+
test_cmp expect actual
175175
'
176176

177177
# Test that the -y flag can override difftool.prompt = true
@@ -180,7 +180,7 @@ test_expect_success PERL 'difftool.prompt can overridden with -y' '
180180
test_config difftool.prompt true &&
181181
echo branch >expect &&
182182
git difftool -y branch >actual &&
183-
test_cmp_text expect actual
183+
test_cmp expect actual
184184
'
185185

186186
# Test that the --prompt flag can override difftool.prompt = false
@@ -198,7 +198,7 @@ test_expect_success PERL 'difftool last flag wins' '
198198
difftool_test_setup &&
199199
echo branch >expect &&
200200
git difftool --prompt --no-prompt branch >actual &&
201-
test_cmp_text expect actual &&
201+
test_cmp expect actual &&
202202
echo >input &&
203203
git difftool --no-prompt --prompt branch <input >output &&
204204
prompt=$(tail -1 <output) &&
@@ -212,13 +212,13 @@ test_expect_success PERL 'difftool + mergetool config variables' '
212212
test_config mergetool.test-tool.cmd "cat \$LOCAL" &&
213213
echo branch >expect &&
214214
git difftool --no-prompt branch >actual &&
215-
test_cmp_text expect actual &&
215+
test_cmp expect actual &&
216216
217217
# set merge.tool to something bogus, diff.tool to test-tool
218218
test_config merge.tool bogus-tool &&
219219
test_config diff.tool test-tool &&
220220
git difftool --no-prompt branch >actual &&
221-
test_cmp_text expect actual
221+
test_cmp expect actual
222222
'
223223

224224
test_expect_success PERL 'difftool.<tool>.path' '
@@ -232,21 +232,21 @@ test_expect_success PERL 'difftool --extcmd=cat' '
232232
echo branch >expect &&
233233
echo master >>expect &&
234234
git difftool --no-prompt --extcmd=cat branch >actual &&
235-
test_cmp_text expect actual
235+
test_cmp expect actual
236236
'
237237

238238
test_expect_success PERL 'difftool --extcmd cat' '
239239
echo branch >expect &&
240240
echo master >>expect &&
241241
git difftool --no-prompt --extcmd=cat branch >actual &&
242-
test_cmp_text expect actual
242+
test_cmp expect actual
243243
'
244244

245245
test_expect_success PERL 'difftool -x cat' '
246246
echo branch >expect &&
247247
echo master >>expect &&
248248
git difftool --no-prompt -x cat branch >actual &&
249-
test_cmp_text expect actual
249+
test_cmp expect actual
250250
'
251251

252252
test_expect_success PERL 'difftool --extcmd echo arg1' '
@@ -260,14 +260,14 @@ test_expect_success PERL 'difftool --extcmd cat arg1' '
260260
echo master >expect &&
261261
git difftool --no-prompt \
262262
--extcmd sh\ -c\ \"cat\ \$1\" branch >actual &&
263-
test_cmp_text expect actual
263+
test_cmp expect actual
264264
'
265265

266266
test_expect_success PERL 'difftool --extcmd cat arg2' '
267267
echo branch >expect &&
268268
git difftool --no-prompt \
269269
--extcmd sh\ -c\ \"cat\ \$2\" branch >actual &&
270-
test_cmp_text expect actual
270+
test_cmp expect actual
271271
'
272272

273273
# Create a second file on master and a different version on branch

t/test-lib-functions.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,3 +866,11 @@ mingw_read_file_strip_cr_ () {
866866
eval "$1=\$$1\$line"
867867
done
868868
}
869+
870+
# Perform dos2unix line ending conversion for binary files
871+
d2u_force() {
872+
if test_have_prereq MINGW
873+
then
874+
dos2unix --force "$1"
875+
fi
876+
}

0 commit comments

Comments
 (0)