develooper Front page | perl.perl5.porters | Postings from July 2001

[PATCH: perl@11181] UCD.t fails LATIN|Latin test

Thread Previous | Thread Next
From:
Prymmer/Kahn
Date:
July 8, 2001 17:07
Subject:
[PATCH: perl@11181] UCD.t fails LATIN|Latin test
Message ID:
Pine.BSF.4.21.0107081701270.12764-100000@shell8.ba.best.com

Greetings,

Perl@11181 cannot builkd since there is no definition for WARN_OCTMODE
nor WARN_MKDIR in warnings.h (there may also need to be changes to
warnings.pl and/or warnings.pm?).  The current state of warnings.h
was left unmodified by the patch from Abhijit Menon-Sen for 
"mkdir() mode argument is missing initial 0":

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-07/msg00275.html

More work is needed there - I do not yet have a fix for warnings.h
(By the way is this warning useful?  Why does perl care if I say mkdir
dirnam 777 or mkdir dirnam, 0777?  What happens if I run:

    my $dirname = "dirnam";
    my $mode = 0777;
    mkdir $dirname, $mode;

? What happens if I say C<my $mode = 777;> instead?).

With a buthcered warnings.h modified to #define the requisite constants
(although apparently in an incomplete way) I noted in testing that
lib/Unicode/UCD.t fails two tests (#17 and #34). I suspect that these
lines in Unicode::UCD.pm::_charscripts() are responsible:

                    my $script = lc($3);
                    $script =~ s/\b(\w)/uc($1)/ge;

I am not sure if those lines were intended to be there, but if they were
then it would appear that the expectation in the corresponding test ought 
to be modified; perhaps like so:


*** lib/Unicode/UCD.t.orig Sun Jul  8 15:58:24 2001
--- lib/Unicode/UCD.t Sun Jul  8 16:28:22 2001
***************
*** 27,33 ****
  ok($charinfo{lower},          '0061');
  ok($charinfo{title},          '');
  ok($charinfo{block},          'Basic Latin');
! ok($charinfo{script},         'LATIN');
  
  %charinfo = charinfo(0x100);
  
--- 27,33 ----
  ok($charinfo{lower},          '0061');
  ok($charinfo{title},          '');
  ok($charinfo{block},          'Basic Latin');
! ok($charinfo{script},         'Latin');
  
  %charinfo = charinfo(0x100);
  
***************
*** 47,53 ****
  ok($charinfo{lower},          '0101');
  ok($charinfo{title},          '');
  ok($charinfo{block},          'Latin Extended-A');
! ok($charinfo{script},         'LATIN');
  
  # 0x0590 is in the Hebrew block but unused.
  
--- 47,53 ----
  ok($charinfo{lower},          '0101');
  ok($charinfo{title},          '');
  ok($charinfo{block},          'Latin Extended-A');
! ok($charinfo{script},         'Latin');
  
  # 0x0590 is in the Hebrew block but unused.
  


End of Patch.

With that applied lib/Unicode/UCD.t passes all tests on win32.  Of course
one might argue that the naming of things like scripts such as "LATIN"
ought not be modified by perl modules reading in the Unicode db, in which 
case UCD.pm ought to be modified rather than UCD.t.

Peter Prymmer





Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About