changeset 3783:4421cef5d3f0

Make quoting in test-encoding simpler
author Matt Mackall <mpm@selenic.com>
date Mon, 04 Dec 2006 14:32:02 -0600
parents a8725ae15c7c
children 1427949b8f80
files tests/test-encoding tests/test-encoding.out
diffstat 2 files changed, 42 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-encoding	Mon Dec 04 01:21:53 2006 -0600
+++ b/tests/test-encoding	Mon Dec 04 14:32:02 2006 -0600
@@ -7,22 +7,32 @@
 hg unbundle $TESTDIR/legacy-encoding.hg
 hg co
 
+printf "latin-1 e' encoded: \xe9" > latin-1
+printf "utf-8 e' encoded: \xc3\xa9" > utf-8
+printf "\xe9" > latin-1-tag
+
 echo % should fail with encoding error
 echo "plain old ascii" > a
 hg st
-HGENCODING=ascii hg ci -m "`printf "ascii 0xe9: \xe9"`" -d "0 0"
+HGENCODING=ascii hg ci -l latin-1 -d "0 0"
 
 echo % these should work
 echo "latin-1" > a
-HGENCODING=latin-1 hg ci -m "`printf "latin-1 e' encoded: \xe9"`" -d "0 0"
+HGENCODING=latin-1 hg ci -l latin-1 -d "0 0"
 echo "utf-8" > a
-HGENCODING=utf-8 hg ci -m "`printf "utf-8 e': \xc3\xa9"`" -d "0 0"
+HGENCODING=utf-8 hg ci -l utf-8 -d "0 0"
 
-HGENCODING=latin-1 hg tag -d "0 0" "`printf "\xe9"`"
+HGENCODING=latin-1 hg tag -d "0 0" `cat latin-1-tag`
 
+echo % ascii
 hg --encoding ascii log
+echo % latin-1
 hg --encoding latin-1 log
+echo % utf-8
 hg --encoding utf-8 log
+echo % ascii
 HGENCODING=ascii hg tags
+echo % latin-1
 HGENCODING=latin-1 hg tags
+echo % utf-8
 HGENCODING=utf-8 hg tags
--- a/tests/test-encoding.out	Mon Dec 04 01:21:53 2006 -0600
+++ b/tests/test-encoding.out	Mon Dec 04 14:32:02 2006 -0600
@@ -6,22 +6,26 @@
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 % should fail with encoding error
 M a
-abort: decoding near 'cii 0xe9: é': 'ascii' codec can't decode byte 0xe9 in position 12: ordinal not in range(128)!
+? latin-1
+? latin-1-tag
+? utf-8
+abort: decoding near ' encoded: é': 'ascii' codec can't decode byte 0xe9 in position 20: ordinal not in range(128)!
 
 transaction abort!
 rollback completed
 % these should work
-changeset:   3:d6b63b86e629
+% ascii
+changeset:   3:5edfc7acb541
 tag:         tip
 user:        test
 date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Added tag ? for changeset 20ea57f280ca
+summary:     Added tag ? for changeset 91878608adb3
 
-changeset:   2:20ea57f280ca
+changeset:   2:91878608adb3
 tag:         ?
 user:        test
 date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     utf-8 e': ?
+summary:     utf-8 e' encoded: ?
 
 changeset:   1:6355cacf842e
 user:        test
@@ -33,17 +37,18 @@
 date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     latin-1 e': ?
 
-changeset:   3:d6b63b86e629
+% latin-1
+changeset:   3:5edfc7acb541
 tag:         tip
 user:        test
 date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Added tag é for changeset 20ea57f280ca
+summary:     Added tag é for changeset 91878608adb3
 
-changeset:   2:20ea57f280ca
+changeset:   2:91878608adb3
 tag:         é
 user:        test
 date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     utf-8 e': é
+summary:     utf-8 e' encoded: é
 
 changeset:   1:6355cacf842e
 user:        test
@@ -55,17 +60,18 @@
 date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     latin-1 e': é
 
-changeset:   3:d6b63b86e629
+% utf-8
+changeset:   3:5edfc7acb541
 tag:         tip
 user:        test
 date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Added tag é for changeset 20ea57f280ca
+summary:     Added tag é for changeset 91878608adb3
 
-changeset:   2:20ea57f280ca
+changeset:   2:91878608adb3
 tag:         é
 user:        test
 date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     utf-8 e': é
+summary:     utf-8 e' encoded: é
 
 changeset:   1:6355cacf842e
 user:        test
@@ -77,9 +83,12 @@
 date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     latin-1 e': é
 
-tip                                3:d6b63b86e629
-?                                  2:20ea57f280ca
-tip                                3:d6b63b86e629
-é                                  2:20ea57f280ca
-tip                                3:d6b63b86e629
-é                                  2:20ea57f280ca
+% ascii
+tip                                3:5edfc7acb541
+?                                  2:91878608adb3
+% latin-1
+tip                                3:5edfc7acb541
+é                                  2:91878608adb3
+% utf-8
+tip                                3:5edfc7acb541
+é                                  2:91878608adb3