@matheusbsbs / matheus-bagliano / commits / 7b7247b0d7
Fork 0

t9100, t9129: Use prerequisite tags for UTF-8 tests

Signed-off-by: Johannes Sixt <j6t@kdbg.org>

Johannes Sixt committed Feb 24, 2009 at 21:13 UTC 7b7247b0d7cb6a105d87574642343480707414b3
2 files changed +28 -31
t/t9100-git-svn-basic.sh
+16 -21
@@ -6,19 +6,19 @@
6 test_description='git svn basic tests'
7 GIT_SVN_LC_ALL=${LC_ALL:-$LANG}
8
9 +. ./lib-git-svn.sh
10 +
11 +say 'define NO_SVN_TESTS to skip git svn tests'
12 +
13 case "$GIT_SVN_LC_ALL" in
14 *.UTF-8)
11 - have_utf8=t
15 + test_set_prereq UTF8
16 ;;
17 *)
14 - have_utf8=
18 + say "UTF-8 locale not set, some tests skipped ($GIT_SVN_LC_ALL)"
19 ;;
20 esac
21
18 -. ./lib-git-svn.sh
19 -
20 -say 'define NO_SVN_TESTS to skip git svn tests'
21 -
22 test_expect_success \
23 'initialize git svn' '
24 mkdir import &&
@@ -171,20 +171,15 @@ test_expect_success "$name" '
171 test ! -L "$SVN_TREE"/exec-2.sh &&
172 test_cmp help "$SVN_TREE"/exec-2.sh'
173
174 -if test "$have_utf8" = t
175 -then
176 - name="commit with UTF-8 message: locale: $GIT_SVN_LC_ALL"
177 - LC_ALL="$GIT_SVN_LC_ALL"
178 - export LC_ALL
179 - test_expect_success "$name" "
180 - echo '# hello' >> exec-2.sh &&
181 - git update-index exec-2.sh &&
182 - git commit -m 'éï∏' &&
183 - git svn set-tree HEAD"
184 - unset LC_ALL
185 -else
186 - say "UTF-8 locale not set, test skipped ($GIT_SVN_LC_ALL)"
187 -fi
174 +name="commit with UTF-8 message: locale: $GIT_SVN_LC_ALL"
175 +LC_ALL="$GIT_SVN_LC_ALL"
176 +export LC_ALL
177 +test_expect_success UTF8 "$name" "
178 + echo '# hello' >> exec-2.sh &&
179 + git update-index exec-2.sh &&
180 + git commit -m 'éï∏' &&
181 + git svn set-tree HEAD"
182 +unset LC_ALL
183
184 name='test fetch functionality (svn => git) with alternate GIT_SVN_ID'
185 GIT_SVN_ID=alt
@@ -197,7 +192,7 @@ test_expect_success "$name" \
192
193 name='check imported tree checksums expected tree checksums'
194 rm -f expected
200 -if test "$have_utf8" = t
195 +if test_have_prereq UTF8
196 then
197 echo tree bf522353586b1b883488f2bc73dab0d9f774b9a9 > expected
198 fi
t/t9129-git-svn-i18n-commitencoding.sh
+12 -10
@@ -70,24 +70,26 @@ do
70 done
71
72 if locale -a |grep -q en_US.utf8; then
73 - test_expect_success 'ISO-8859-1 should match UTF-8 in svn' '
73 + test_set_prereq UTF8
74 +else
75 + say "UTF-8 locale not available, test skipped"
76 +fi
77 +
78 +test_expect_success UTF8 'ISO-8859-1 should match UTF-8 in svn' '
79 (
80 cd ISO-8859-1 &&
81 compare_svn_head_with "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
82 )
78 - '
83 +'
84
80 - for H in EUCJP ISO-2022-JP
81 - do
82 - test_expect_success '$H should match UTF-8 in svn' '
85 +for H in EUCJP ISO-2022-JP
86 +do
87 + test_expect_success UTF8 "$H should match UTF-8 in svn" '
88 (
89 cd $H &&
90 compare_svn_head_with "$TEST_DIRECTORY"/t3900/2-UTF-8.txt
91 )
87 - '
88 - done
89 -else
90 - say "UTF-8 locale not available, test skipped"
91 -fi
92 + '
93 +done
94
95 test_done