[MacPerl-Porters] [PATCHES] charnames.pm & charnames.t (was: charnames.t, diagnostics.t for MacPerl 5.7.3/5.8.0)
[email protected] (Thomas Wegner) Thu, 30 May 2002 10:46:48 +0200
| Newsgroups | perl.macperl.porters |
|---|---|
| Message-ID | <p04320400b91b95c00e76@[149.225.138.148]> |
At 20:22 Uhr +0300 29.05.2002, Jarkko Hietaniemi wrote:
>On Wed, May 29, 2002 at 07:11:38PM +0200, Thomas Wegner wrote:
>> Greetings,
>>
>> here are patches for :lib:charnames.t and :lib:diagnostics.t (MacPerl
>> 5.7.3/5.8.0).
>>
>>
>> diff -ru charnames.t.orig charnames.t
>> --- charnames.t.orig Wed May 8 01:26:57 2002
>> +++ charnames.t Fri May 24 19:19:21 2002
>> @@ -173,13 +173,13 @@
>> print "not " unless "\N{NULL}" eq "\c@";
>> print "ok 25\n";
>>
>> -print "not " unless "\N{LINE FEED (LF)}" eq "\n";
>> +print "not " unless "\N{LINE FEED (LF)}" eq "\012";
>> print "ok 26\n";
>
>Uhh, no. Won't work on EBCDIC. Skip the tests on MacOS
>if you need to. Or make the expected result (like "\n")
>dependent on $^O eq 'MacOS'.
>
[snip]
I stand corrected. But hey, it helped to find a nit in charnames.pm
(see below). I'm also
sending a corrected patch for charnames.t.
diff -ru charnames.pm.orig charnames.pm
--- charnames.pm.orig Thu May 30 10:22:52 2002
+++ charnames.pm Thu May 30 10:22:53 2002
@@ -16,7 +16,7 @@
# Convenience.
'LF' => 'LINE FEED (LF)',
'FF' => 'FORM FEED (FF)',
- 'CR' => 'CARRIAGE RETURN (LF)',
+ 'CR' => 'CARRIAGE RETURN (CR)',
'NEL' => 'NEXT LINE (NEL)',
# More convenience. For futher convencience,
# it is suggested some way using using the NamesList
diff -ru charnames.t.orig charnames.t
--- charnames.t.orig Wed May 8 01:26:57 2002
+++ charnames.t Thu May 30 10:20:36 2002
@@ -173,14 +173,28 @@
print "not " unless "\N{NULL}" eq "\c@";
print "ok 25\n";
-print "not " unless "\N{LINE FEED (LF)}" eq "\n";
-print "ok 26\n";
+if ($^O eq 'MacOS')
+{
+ print "not " unless "\N{CARRIAGE RETURN (CR)}" eq "\n";
+ print "ok 26\n";
-print "not " unless "\N{LINE FEED}" eq "\n";
-print "ok 27\n";
+ print "not " unless "\N{CARRIAGE RETURN}" eq "\n";
+ print "ok 27\n";
-print "not " unless "\N{LF}" eq "\n";
-print "ok 28\n";
+ print "not " unless "\N{CR}" eq "\n";
+ print "ok 28\n";
+}
+else
+{
+ print "not " unless "\N{LINE FEED (LF)}" eq "\n";
+ print "ok 26\n";
+
+ print "not " unless "\N{LINE FEED}" eq "\n";
+ print "ok 27\n";
+
+ print "not " unless "\N{LF}" eq "\n";
+ print "ok 28\n";
+}
my $nel = ord("A") == 193 ? qr/^(?:\x15|\x25)$/ : qr/^\x85$/;
__END__ of 2 patches
Best regards,
--Thomas