Skip to content

Commit 8445370

Browse files
pks-tgitster
authored andcommitted
t9822: use prereq to check for ISO-8859-1 support
Tests in t9822 depend on filesystem support for ISO-8859-1 encoding. We thus have a block of code that acts as a prerequisite -- if we fail to write a file with an ISO-8859-1-encoded file name to disk then we skip all tests. When the prerequisite fails though we end up printing an error message to stderr, which breaks the TAP format. Fix this by converting the code to a proper prerequisite, which handles output redirection for us. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ddfcb9d commit 8445370

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

t/t9822-git-p4-path-encoding.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ test_description='Clone repositories with non ASCII paths'
77
UTF8_ESCAPED="a-\303\244_o-\303\266_u-\303\274.txt"
88
ISO8859_ESCAPED="a-\344_o-\366_u-\374.txt"
99

10-
ISO8859="$(printf "$ISO8859_ESCAPED")" &&
11-
echo content123 >"$ISO8859" &&
12-
rm "$ISO8859" || {
10+
test_lazy_prereq FS_ACCEPTS_ISO_8859_1 '
11+
ISO8859="$(printf "$ISO8859_ESCAPED")" &&
12+
echo content123 >"$ISO8859" &&
13+
rm "$ISO8859"
14+
'
15+
16+
if ! test_have_prereq FS_ACCEPTS_ISO_8859_1
17+
then
1318
skip_all="fs does not accept ISO-8859-1 filenames"
1419
test_done
15-
}
20+
fi
1621

1722
test_expect_success 'start p4d' '
1823
start_p4d

0 commit comments

Comments
 (0)