Skip to content

Commit f6af6f9

Browse files
avargitster
authored andcommitted
tests: fix non-portable iconv invocation
The iconv that comes with a FreeBSD 11.2-RELEASE-p2 box I have access to doesn't support the SHIFT-JIS encoding. Guard a test added in e92d622 ("convert: add round trip check based on 'core.checkRoundtripEncoding'", 2018-04-15) first released with Git v2.18.0 with a prerequisite that checks for its availability. The iconv command is in POSIX, and we have numerous tests unconditionally relying on its ability to convert ASCII, UTF-8 and UTF-16, but unconditionally relying on the presence of more obscure encodings isn't portable. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Reviewed-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent de231e5 commit f6af6f9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

t/t0028-working-tree-encoding.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,11 @@ test_expect_success 'error if encoding garbage is already in Git' '
203203
test_i18ngrep "error: BOM is required" err.out
204204
'
205205

206-
test_expect_success 'check roundtrip encoding' '
206+
test_lazy_prereq ICONV_SHIFT_JIS '
207+
iconv -f UTF-8 -t SHIFT-JIS </dev/null
208+
'
209+
210+
test_expect_success ICONV_SHIFT_JIS 'check roundtrip encoding' '
207211
test_when_finished "rm -f roundtrip.shift roundtrip.utf16" &&
208212
test_when_finished "git reset --hard HEAD" &&
209213

0 commit comments

Comments
 (0)