Browse Source

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>
maint
Torsten Bögershausen 12 years ago committed by Junio C Hamano
parent
commit
924f6c3d39
  1. 38
      contrib/remote-helpers/test-bzr.sh

38
contrib/remote-helpers/test-bzr.sh

@ -169,31 +169,30 @@ test_expect_success 'fetch utf-8 filenames' '
mkdir -p tmp && cd tmp && mkdir -p tmp && cd tmp &&
test_when_finished "cd .. && rm -rf tmp && LC_ALL=C" && test_when_finished "cd .. && rm -rf tmp && LC_ALL=C" &&


export LC_ALL=en_US.UTF-8 LC_ALL=en_US.UTF-8

export LC_ALL
( (
bzr init bzrrepo && bzr init bzrrepo &&
cd bzrrepo && cd bzrrepo &&


echo test >> "áéíóú" && echo test >> "ærø" &&
bzr add "áéíóú" && bzr add "ærø" &&
echo test >> "îø∫∆" && echo test >> "ø~?" &&
bzr add "îø∫∆" && bzr add "ø~?" &&
bzr commit -m utf-8 && bzr commit -m add-utf-8 &&
echo test >> "áéíóú" && echo test >> "ærø" &&
bzr commit -m utf-8 && bzr commit -m test-utf-8 &&
bzr rm "îø∫∆" && bzr rm "ø~?" &&
bzr mv "áéíóú" "åß∂" && bzr mv "ærø" "ø~?" &&
bzr commit -m utf-8 bzr commit -m bzr-mv-utf-8
) && ) &&


( (
git clone "bzr::$PWD/bzrrepo" gitrepo && git clone "bzr::$PWD/bzrrepo" gitrepo &&
cd gitrepo && cd gitrepo &&
git ls-files > ../actual git -c core.quotepath=false ls-files > ../actual
) && ) &&

echo "ø~?" > expected &&
echo "\"\\303\\245\\303\\237\\342\\210\\202\"" > expected &&
test_cmp expected actual test_cmp expected actual
' '


@ -201,7 +200,8 @@ test_expect_success 'push utf-8 filenames' '
mkdir -p tmp && cd tmp && mkdir -p tmp && cd tmp &&
test_when_finished "cd .. && rm -rf tmp && LC_ALL=C" && test_when_finished "cd .. && rm -rf tmp && LC_ALL=C" &&


export LC_ALL=en_US.UTF-8 LC_ALL=en_US.UTF-8
export LC_ALL


( (
bzr init bzrrepo && bzr init bzrrepo &&
@ -216,15 +216,15 @@ test_expect_success 'push utf-8 filenames' '
git clone "bzr::$PWD/bzrrepo" gitrepo && git clone "bzr::$PWD/bzrrepo" gitrepo &&
cd gitrepo && cd gitrepo &&


echo test >> "áéíóú" && echo test >> "ærø" &&
git add "áéíóú" && git add "ærø" &&
git commit -m utf-8 && git commit -m utf-8 &&


git push git push
) && ) &&


(cd bzrrepo && bzr ls > ../actual) && (cd bzrrepo && bzr ls > ../actual) &&
echo -e "content\náéíóú" > expected && printf "content\nærø\n" > expected &&
test_cmp expected actual test_cmp expected actual
' '



Loading…
Cancel
Save