diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-02-22 09:26:06 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-02-22 09:26:06 +0000 |
commit | 012bcf8d26492bcf446b8c77c363cfa2f1a6a609 (patch) | |
tree | 150b73084c158f31e3657933a40e1661d8df0586 /t/pragma/warn | |
parent | e526c9e6a142067a8efdc8a9f757505ff724adb1 (diff) | |
download | perl-012bcf8d26492bcf446b8c77c363cfa2f1a6a609.tar.gz |
improvements for high-bit text literals (from Gisle Aas)
p4raw-id: //depot/perl@5192
Diffstat (limited to 't/pragma/warn')
-rw-r--r-- | t/pragma/warn/doop | 23 | ||||
-rw-r--r-- | t/pragma/warn/pp | 22 | ||||
-rw-r--r-- | t/pragma/warn/sv | 19 | ||||
-rw-r--r-- | t/pragma/warn/toke | 19 | ||||
-rw-r--r-- | t/pragma/warn/utf8 | 46 |
5 files changed, 7 insertions, 122 deletions
diff --git a/t/pragma/warn/doop b/t/pragma/warn/doop index c16e24f919..5803b44581 100644 --- a/t/pragma/warn/doop +++ b/t/pragma/warn/doop @@ -1,29 +1,6 @@ - doop.c AOK - - \x%s will produce malformed UTF-8 character; use \x{%s} for that - - -__END__ # doop.c use utf8 ; $_ = "\x80 \xff" ; chop ; EXPECT ######## -# doop.c -BEGIN { - if (ord("\t") == 5) { - print "SKIPPED\n# Character codes differ on ebcdic machines."; - exit 0; - } -} -use warnings 'utf8' ; -use utf8 ; -$_ = "\x80 \xff" ; -chop ; -no warnings 'utf8' ; -$_ = "\x80 \xff" ; -chop ; -EXPECT -\x80 will produce malformed UTF-8 character; use \x{80} for that at - line 10. -\xff will produce malformed UTF-8 character; use \x{ff} for that at - line 10. diff --git a/t/pragma/warn/pp b/t/pragma/warn/pp index b392029767..8f42ba64ec 100644 --- a/t/pragma/warn/pp +++ b/t/pragma/warn/pp @@ -28,11 +28,6 @@ Constant subroutine %s undefined <<<TODO Constant subroutine (anonymous) undefined <<<TODO - Mandatory Warnings - ------------------ - Malformed UTF-8 character (not tested: difficult to produce with - perl now) - __END__ # pp.c use warnings 'substr' ; @@ -113,20 +108,3 @@ $_ = "\x80 \xff" ; reverse ; EXPECT ######## -# pp.c -BEGIN { - if (ord("\t") == 5) { - print "SKIPPED\n# Character codes differ on ebcdic machines."; - exit 0; - } -} -use warnings 'utf8' ; -use utf8 ; -$_ = "\x80 \xff" ; -reverse ; -no warnings 'utf8' ; -$_ = "\x80 \xff" ; -reverse ; -EXPECT -\x80 will produce malformed UTF-8 character; use \x{80} for that at - line 10. -\xff will produce malformed UTF-8 character; use \x{ff} for that at - line 10. diff --git a/t/pragma/warn/sv b/t/pragma/warn/sv index 9a2428e0cb..758137f2e8 100644 --- a/t/pragma/warn/sv +++ b/t/pragma/warn/sv @@ -269,25 +269,6 @@ EXPECT Undefined value assigned to typeglob at - line 3. ######## # sv.c -BEGIN { - if (ord("\t") == 5) { - print "SKIPPED\n# ebcdic \\x characters differ."; - exit 0; - } -} -use utf8 ; -$^W =0 ; -{ - use warnings 'utf8' ; - my $a = rindex "a\xff bc ", "bc" ; - no warnings 'utf8' ; - $a = rindex "a\xff bc ", "bc" ; -} -my $a = rindex "a\xff bc ", "bc" ; -EXPECT -\xff will produce malformed UTF-8 character; use \x{ff} for that at - line 12. -######## -# sv.c use warnings 'y2k'; use Config; BEGIN { diff --git a/t/pragma/warn/toke b/t/pragma/warn/toke index 271ef6365c..cfdea78d3c 100644 --- a/t/pragma/warn/toke +++ b/t/pragma/warn/toke @@ -89,10 +89,6 @@ toke.c AOK sub time {} my $a = time() - \x%.*s will produce malformed UTF-8 character; use \x{%.*s} for that - use utf8 ; - $_ = "\xffe" - Unrecognized escape \\%c passed through $a = "\m" ; @@ -447,21 +443,6 @@ EXPECT ######## # toke.c -BEGIN { - if (ord("\t") == 5) { - print "SKIPPED\n# Ebcdic platforms have different \\x constructs."; - exit 0; - } -} -use warnings 'utf8' ; -use utf8 ; -$_ = " \xffe " ; -no warnings 'utf8' ; -$_ = " \xffe " ; -EXPECT -\xff will produce malformed UTF-8 character; use \x{ff} for that at - line 10. -######## -# toke.c my $a = rand + 4 ; EXPECT Warning: Use of "rand" without parens is ambiguous at - line 2. diff --git a/t/pragma/warn/utf8 b/t/pragma/warn/utf8 index cb1f202b8d..6a2fe5446c 100644 --- a/t/pragma/warn/utf8 +++ b/t/pragma/warn/utf8 @@ -14,48 +14,16 @@ <<<<<< Add a test when somethig actually calls utf16_to_utf8 __END__ -# utf8.c [utf8_to_uv] +# utf8.c [utf8_to_uv] -W use utf8 ; -my $a = ord "\x80" ; -EXPECT -######## -# utf8.c [utf8_to_uv] -BEGIN { - if (ord("\t") == 5) { - print "SKIPPED\n# Ebcdic platforms have different \\x constructs."; - exit 0; - } -} -use utf8 ; -my $a = ord "\x80" ; +my $a = "snøstorm" ; { - use warnings 'utf8' ; - my $a = ord "\x80" ; no warnings 'utf8' ; - my $a = ord "\x80" ; -} -EXPECT -\x80 will produce malformed UTF-8 character; use \x{80} for that at - line 12. -######## -# utf8.c [utf8_to_uv] -use utf8 ; -my $a = ord "\xf080" ; -EXPECT -######## -# utf8.c [utf8_to_uv] -BEGIN { - if (ord("\t") == 5) { - print "SKIPPED\n# Ebcdic platforms have different \\x constructs."; - exit 0; - } -} -use utf8 ; -my $a = ord "\xf080" ; -{ + my $a = "snøstorm"; use warnings 'utf8' ; - my $a = ord "\xf080" ; - no warnings 'utf8' ; - my $a = ord "\xf080" ; + my $a = "snøstorm"; } EXPECT -\xf0 will produce malformed UTF-8 character; use \x{f0} for that at - line 12. +Malformed UTF-8 character at - line 3. +Malformed UTF-8 character at - line 8. +######## |