Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: New D07 test failure



On Sun, 02 Mar 2008 22:30:56 -0800
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Feb 28,  9:51am, Peter Stephenson wrote:
> }
> } OK, so we can't rely on the collation sequence in UTF-8 being consistent
> } across implementations, and we can't rely on "sort" either.  Any other
> } ideas before I simply remove the sort tests?
> 
> Maybe you just need to choose the inputs more carefully?

Yes, maybe it's worth trying with a different well-ordered alphabet before
giving up.  Note those really are Greek upper case letters even though some
may be rendered the same as Roman.  (And people still say a classical
education is useless.  Sheesh.)

Ismail's later problem looked like it was to do with "0" sorting before
".".  Perhaps not making assumptions about punctuation symbols also
helps...  If "0" doesn't come before "t", I will lose interest in fixing
this.

Index: Test/D07multibyte.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/D07multibyte.ztst,v
retrieving revision 1.23
diff -u -r1.23 D07multibyte.ztst
--- Test/D07multibyte.ztst	27 Feb 2008 20:03:23 -0000	1.23
+++ Test/D07multibyte.ztst	3 Mar 2008 16:03:28 -0000
@@ -322,16 +322,10 @@
 # We ask for case-insensitive sorting here (and supply upper case
 # characters) so that we exercise the logic in the shell that lowers the
 # case of the string for case-insensitive sorting.
-# As all letters are upper case, however, sort should produce the same order.
-  print -loi HAH HUH HEH HÉH HÈH >zshsort.txt
-  print -l HAH HUH HEH HÉH HÈH | sort >sortsort.txt
-  print Diff output should be empty
-  diff zshsort.txt sortsort.txt
-  print Sort in C locale
+  print -oi HΕH HΔH HΓH HΒH HΑH
   (LC_ALL=C; print -oi HAH HUH HEH HÉH HÈH)
 0:Multibyte characters in print sorting
->Diff output should be empty
->Sort in C locale
+>HΑH HΒH HΓH HΔH HΕH
 >HAH HEH HUH HÈH HÉH
 
 # These are control characters in Unicode, so don't show up.
@@ -366,24 +360,24 @@
 >1 149
 >1 150
 
-  touch ngs1.txt ngs2.txt ngs10.txt ngs20.txt ngs100.txt ngs200.txt
+  touch ngs1txt ngs2txt ngs10txt ngs20txt ngs100txt ngs200txt
   setopt numericglobsort
   print -l ngs*
   unsetopt numericglobsort
   print -l ngs*
 0:NUMERIC_GLOB_SORT option in UTF-8 locale
->ngs1.txt
->ngs2.txt
->ngs10.txt
->ngs20.txt
->ngs100.txt
->ngs200.txt
->ngs100.txt
->ngs10.txt
->ngs1.txt
->ngs200.txt
->ngs20.txt
->ngs2.txt
+>ngs1txt
+>ngs2txt
+>ngs10txt
+>ngs20txt
+>ngs100txt
+>ngs200txt
+>ngs100txt
+>ngs10txt
+>ngs1txt
+>ngs200txt
+>ngs20txt
+>ngs2txt
 
 # Not strictly multibyte, but gives us a well-defined locale for testing.
   foo=$'X\xc0Y\x07Z\x7fT'


-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



Messages sorted by: Reverse Date, Date, Thread, Author