t9100, t9129: Use prerequisite tags for UTF-8 tests
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
This commit is contained in:
@ -6,19 +6,19 @@
|
|||||||
test_description='git svn basic tests'
|
test_description='git svn basic tests'
|
||||||
GIT_SVN_LC_ALL=${LC_ALL:-$LANG}
|
GIT_SVN_LC_ALL=${LC_ALL:-$LANG}
|
||||||
|
|
||||||
case "$GIT_SVN_LC_ALL" in
|
|
||||||
*.UTF-8)
|
|
||||||
have_utf8=t
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
have_utf8=
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
. ./lib-git-svn.sh
|
. ./lib-git-svn.sh
|
||||||
|
|
||||||
say 'define NO_SVN_TESTS to skip git svn tests'
|
say 'define NO_SVN_TESTS to skip git svn tests'
|
||||||
|
|
||||||
|
case "$GIT_SVN_LC_ALL" in
|
||||||
|
*.UTF-8)
|
||||||
|
test_set_prereq UTF8
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
say "UTF-8 locale not set, some tests skipped ($GIT_SVN_LC_ALL)"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success \
|
||||||
'initialize git svn' '
|
'initialize git svn' '
|
||||||
mkdir import &&
|
mkdir import &&
|
||||||
@ -171,20 +171,15 @@ test_expect_success "$name" '
|
|||||||
test ! -L "$SVN_TREE"/exec-2.sh &&
|
test ! -L "$SVN_TREE"/exec-2.sh &&
|
||||||
test_cmp help "$SVN_TREE"/exec-2.sh'
|
test_cmp help "$SVN_TREE"/exec-2.sh'
|
||||||
|
|
||||||
if test "$have_utf8" = t
|
|
||||||
then
|
|
||||||
name="commit with UTF-8 message: locale: $GIT_SVN_LC_ALL"
|
name="commit with UTF-8 message: locale: $GIT_SVN_LC_ALL"
|
||||||
LC_ALL="$GIT_SVN_LC_ALL"
|
LC_ALL="$GIT_SVN_LC_ALL"
|
||||||
export LC_ALL
|
export LC_ALL
|
||||||
test_expect_success "$name" "
|
test_expect_success UTF8 "$name" "
|
||||||
echo '# hello' >> exec-2.sh &&
|
echo '# hello' >> exec-2.sh &&
|
||||||
git update-index exec-2.sh &&
|
git update-index exec-2.sh &&
|
||||||
git commit -m 'éï∏' &&
|
git commit -m 'éï∏' &&
|
||||||
git svn set-tree HEAD"
|
git svn set-tree HEAD"
|
||||||
unset LC_ALL
|
unset LC_ALL
|
||||||
else
|
|
||||||
say "UTF-8 locale not set, test skipped ($GIT_SVN_LC_ALL)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
name='test fetch functionality (svn => git) with alternate GIT_SVN_ID'
|
name='test fetch functionality (svn => git) with alternate GIT_SVN_ID'
|
||||||
GIT_SVN_ID=alt
|
GIT_SVN_ID=alt
|
||||||
@ -197,7 +192,7 @@ test_expect_success "$name" \
|
|||||||
|
|
||||||
name='check imported tree checksums expected tree checksums'
|
name='check imported tree checksums expected tree checksums'
|
||||||
rm -f expected
|
rm -f expected
|
||||||
if test "$have_utf8" = t
|
if test_have_prereq UTF8
|
||||||
then
|
then
|
||||||
echo tree bf522353586b1b883488f2bc73dab0d9f774b9a9 > expected
|
echo tree bf522353586b1b883488f2bc73dab0d9f774b9a9 > expected
|
||||||
fi
|
fi
|
||||||
|
@ -70,7 +70,12 @@ do
|
|||||||
done
|
done
|
||||||
|
|
||||||
if locale -a |grep -q en_US.utf8; then
|
if locale -a |grep -q en_US.utf8; then
|
||||||
test_expect_success 'ISO-8859-1 should match UTF-8 in svn' '
|
test_set_prereq UTF8
|
||||||
|
else
|
||||||
|
say "UTF-8 locale not available, test skipped"
|
||||||
|
fi
|
||||||
|
|
||||||
|
test_expect_success UTF8 'ISO-8859-1 should match UTF-8 in svn' '
|
||||||
(
|
(
|
||||||
cd ISO-8859-1 &&
|
cd ISO-8859-1 &&
|
||||||
compare_svn_head_with "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
|
compare_svn_head_with "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
|
||||||
@ -79,15 +84,12 @@ if locale -a |grep -q en_US.utf8; then
|
|||||||
|
|
||||||
for H in EUCJP ISO-2022-JP
|
for H in EUCJP ISO-2022-JP
|
||||||
do
|
do
|
||||||
test_expect_success '$H should match UTF-8 in svn' '
|
test_expect_success UTF8 "$H should match UTF-8 in svn" '
|
||||||
(
|
(
|
||||||
cd $H &&
|
cd $H &&
|
||||||
compare_svn_head_with "$TEST_DIRECTORY"/t3900/2-UTF-8.txt
|
compare_svn_head_with "$TEST_DIRECTORY"/t3900/2-UTF-8.txt
|
||||||
)
|
)
|
||||||
'
|
'
|
||||||
done
|
done
|
||||||
else
|
|
||||||
say "UTF-8 locale not available, test skipped"
|
|
||||||
fi
|
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
Reference in New Issue
Block a user