test-bzr: portable shell and utf-8 strings for Mac OS

Make the shell script more portable: - Split export X=Y into 2 lines - Use printf instead of echo -e Use UTF-8 code points which are not decomposed by the filesystem: Code points like "á" will be decomposed by Mac OS X. bzr is unable to find the file "á" on disk. Use code points from unicode which can not be decomposed. In other words, the precompsed form use the same bytes as decomposed. Signed-off-by: Torsten Bögershausen <tboegi@web.de> Acked-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Torsten Bögershausen committed Apr 12, 2013 at 23:18 UTC 924f6c3d3931ea782b0f9abee7b8012fe8e5e0fb
1 file changed +19 -19
contrib/remote-helpers/test-bzr.sh
+19 -19
@@ -169,31 +169,30 @@ test_expect_success 'fetch utf-8 filenames' '
169 mkdir -p tmp && cd tmp &&
170 test_when_finished "cd .. && rm -rf tmp && LC_ALL=C" &&
171
172 - export LC_ALL=en_US.UTF-8
173 -
172 + LC_ALL=en_US.UTF-8
173 + export LC_ALL
174 (
175 bzr init bzrrepo &&
176 cd bzrrepo &&
177
178 - echo test >> "áéíóú" &&
179 - bzr add "áéíóú" &&
180 - echo test >> "îø∫∆" &&
181 - bzr add "îø∫∆" &&
182 - bzr commit -m utf-8 &&
183 - echo test >> "áéíóú" &&
184 - bzr commit -m utf-8 &&
185 - bzr rm "îø∫∆" &&
186 - bzr mv "áéíóú" "åß∂" &&
187 - bzr commit -m utf-8
178 + echo test >> "ærø" &&
179 + bzr add "ærø" &&
180 + echo test >> "ø~?" &&
181 + bzr add "ø~?" &&
182 + bzr commit -m add-utf-8 &&
183 + echo test >> "ærø" &&
184 + bzr commit -m test-utf-8 &&
185 + bzr rm "ø~?" &&
186 + bzr mv "ærø" "ø~?" &&
187 + bzr commit -m bzr-mv-utf-8
188 ) &&
189
190 (
191 git clone "bzr::$PWD/bzrrepo" gitrepo &&
192 cd gitrepo &&
193 - git ls-files > ../actual
193 + git -c core.quotepath=false ls-files > ../actual
194 ) &&
195 -
196 - echo "\"\\303\\245\\303\\237\\342\\210\\202\"" > expected &&
195 + echo "ø~?" > expected &&
196 test_cmp expected actual
197 '
198
@@ -201,7 +200,8 @@ test_expect_success 'push utf-8 filenames' '
200 mkdir -p tmp && cd tmp &&
201 test_when_finished "cd .. && rm -rf tmp && LC_ALL=C" &&
202
204 - export LC_ALL=en_US.UTF-8
203 + LC_ALL=en_US.UTF-8
204 + export LC_ALL
205
206 (
207 bzr init bzrrepo &&
@@ -216,15 +216,15 @@ test_expect_success 'push utf-8 filenames' '
216 git clone "bzr::$PWD/bzrrepo" gitrepo &&
217 cd gitrepo &&
218
219 - echo test >> "áéíóú" &&
220 - git add "áéíóú" &&
219 + echo test >> "ærø" &&
220 + git add "ærø" &&
221 git commit -m utf-8 &&
222
223 git push
224 ) &&
225
226 (cd bzrrepo && bzr ls > ../actual) &&
227 - echo -e "content\náéíóú" > expected &&
227 + printf "content\nærø\n" > expected &&
228 test_cmp expected actual
229 '
230