diff options
Diffstat (limited to 't/pragma')
-rwxr-xr-x | t/pragma/constant.t | 45 | ||||
-rwxr-xr-x | t/pragma/locale.t | 8 | ||||
-rwxr-xr-x | t/pragma/overload.t | 16 | ||||
-rw-r--r-- | t/pragma/strict-subs | 18 | ||||
-rw-r--r-- | t/pragma/strict-vars | 32 | ||||
-rwxr-xr-x | t/pragma/sub_lval.t | 46 | ||||
-rwxr-xr-x | t/pragma/utf8.t | 4 | ||||
-rw-r--r-- | t/pragma/warn/1global | 24 | ||||
-rw-r--r-- | t/pragma/warn/2use | 32 | ||||
-rw-r--r-- | t/pragma/warn/3both | 20 | ||||
-rw-r--r-- | t/pragma/warn/4lint | 20 | ||||
-rw-r--r-- | t/pragma/warn/7fatal | 24 | ||||
-rw-r--r-- | t/pragma/warn/doio | 6 | ||||
-rw-r--r-- | t/pragma/warn/doop | 12 | ||||
-rw-r--r-- | t/pragma/warn/op | 2 | ||||
-rw-r--r-- | t/pragma/warn/pp | 14 | ||||
-rw-r--r-- | t/pragma/warn/pp_ctl | 2 | ||||
-rw-r--r-- | t/pragma/warn/pp_hot | 12 | ||||
-rw-r--r-- | t/pragma/warn/pp_sys | 50 | ||||
-rw-r--r-- | t/pragma/warn/regcomp | 92 | ||||
-rw-r--r-- | t/pragma/warn/sv | 34 | ||||
-rw-r--r-- | t/pragma/warn/toke | 8 | ||||
-rw-r--r-- | t/pragma/warn/utf8 | 24 |
23 files changed, 391 insertions, 154 deletions
diff --git a/t/pragma/constant.t b/t/pragma/constant.t index 15ce319c02..5904a4f2b6 100755 --- a/t/pragma/constant.t +++ b/t/pragma/constant.t @@ -14,9 +14,9 @@ END { print @warnings } ######################### We start with some black magic to print on failure. -BEGIN { $| = 1; print "1..46\n"; } +BEGIN { $| = 1; print "1..58\n"; } END {print "not ok 1\n" unless $loaded;} -use constant; +use constant 1.01; $loaded = 1; #print "# Version: $constant::VERSION\n"; print "ok 1\n"; @@ -151,7 +151,46 @@ print CHASH->{foo}; print CARRAY->[1]; print CPHASH->{foo}; eval q{ CPHASH->{bar} }; -test 44, scalar($@ =~ /^No such array/); +test 44, scalar($@ =~ /^No such pseudo-hash field/); print CCODE->(45); eval q{ CCODE->{foo} }; test 46, scalar($@ =~ /^Constant is not a HASH/); + +# Allow leading underscore +use constant _PRIVATE => 47; +test 47, _PRIVATE == 47; + +# Disallow doubled leading underscore +eval q{ + use constant __DISALLOWED => "Oops"; +}; +test 48, $@ =~ /begins with '__'/; + +# Check on declared() and %declared. This sub should be EXACTLY the +# same as the one quoted in the docs! +sub declared ($) { + use constant 1.01; # don't omit this! + my $name = shift; + $name =~ s/^::/main::/; + my $pkg = caller; + my $full_name = $name =~ /::/ ? $name : "${pkg}::$name"; + $constant::declared{$full_name}; +} + +test 49, declared 'PI'; +test 50, $constant::declared{'main::PI'}; + +test 51, !declared 'PIE'; +test 52, !$constant::declared{'main::PIE'}; + +{ + package Other; + use constant IN_OTHER_PACK => 42; + ::test 53, ::declared 'IN_OTHER_PACK'; + ::test 54, $constant::declared{'Other::IN_OTHER_PACK'}; + ::test 55, ::declared 'main::PI'; + ::test 56, $constant::declared{'main::PI'}; +} + +test 57, declared 'Other::IN_OTHER_PACK'; +test 58, $constant::declared{'Other::IN_OTHER_PACK'}; diff --git a/t/pragma/locale.t b/t/pragma/locale.t index c453c47bd1..76426787ca 100755 --- a/t/pragma/locale.t +++ b/t/pragma/locale.t @@ -286,6 +286,11 @@ Turkish:tr:tr:9 turkish8 Yiddish:::1 15 EOF +if ($^O eq 'os390') { + $locales =~ s/Svenska Swedish:sv:fi se:1 15\n//; + $locales =~ s/Thai:th:th:11 tis620\n//; +} + sub in_utf8 () { $^H & 0x08 } if (in_utf8) { @@ -323,6 +328,9 @@ sub decode_encodings { push @enc, $_; } } + if ($^O eq 'os390') { + push @enc, qw(IBM-037 IBM-819 IBM-1047); + } return @enc; } diff --git a/t/pragma/overload.t b/t/pragma/overload.t index ff8d8059f1..f9a9c59c87 100755 --- a/t/pragma/overload.t +++ b/t/pragma/overload.t @@ -712,7 +712,14 @@ test($c, "bareword"); # 135 sub new { my ($p, $v) = @_; bless \$v, $p } sub iter { my ($x) = @_; return undef if $$x < 0; return $$x--; } } -{ + +# XXX iterator overload not intended to work with CORE::GLOBAL? +if (defined &CORE::GLOBAL::glob) { + test '1', '1'; # 175 + test '1', '1'; # 176 + test '1', '1'; # 177 +} +else { my $iter = iterator->new(5); my $acc = ''; my $out; @@ -752,7 +759,12 @@ test($c, "bareword"); # 135 }, 'deref'; # Hash: my @cont = sort %$deref; - test "@cont", '23 5 fake foo'; # 178 + if ("\t" eq "\011") { # ascii + test "@cont", '23 5 fake foo'; # 178 + } + else { # ebcdic alpha-numeric sort order + test "@cont", 'fake foo 23 5'; # 178 + } my @keys = sort keys %$deref; test "@keys", 'fake foo'; # 179 my @val = sort values %$deref; diff --git a/t/pragma/strict-subs b/t/pragma/strict-subs index deeb381473..ed4fe7a443 100644 --- a/t/pragma/strict-subs +++ b/t/pragma/strict-subs @@ -33,6 +33,24 @@ Execution of - aborted due to compilation errors. ######## # strict subs - error +use strict 'subs' ; +my @a = (A..Z); +EXPECT +Bareword "Z" not allowed while "strict subs" in use at - line 4. +Bareword "A" not allowed while "strict subs" in use at - line 4. +Execution of - aborted due to compilation errors. +######## + +# strict subs - error +use strict 'subs' ; +my $a = (B..Y); +EXPECT +Bareword "Y" not allowed while "strict subs" in use at - line 4. +Bareword "B" not allowed while "strict subs" in use at - line 4. +Execution of - aborted due to compilation errors. +######## + +# strict subs - error use strict ; Fred ; EXPECT diff --git a/t/pragma/strict-vars b/t/pragma/strict-vars index b8108d278c..dc11f5d59e 100644 --- a/t/pragma/strict-vars +++ b/t/pragma/strict-vars @@ -307,3 +307,35 @@ print our $fred,"\n"; EXPECT 2 1 +######## + +# "nailed" our declaration visibility across package boundaries +use strict 'vars'; +our $foo; +$foo = 20; +package Foo; +print $foo, "\n"; +EXPECT +20 +######## + +# multiple our declarations in same scope, different packages, no warning +use strict 'vars'; +use warnings; +our $foo; +${foo} = 10; +package Foo; +our $foo = 20; +print $foo, "\n"; +EXPECT +20 +######## + +# multiple our declarations in same scope, same package, warning +use strict 'vars'; +use warnings; +our $foo; +${foo} = 10; +our $foo; +EXPECT +"our" variable $foo masks earlier declaration in same scope at - line 7. diff --git a/t/pragma/sub_lval.t b/t/pragma/sub_lval.t index c382ad52ae..e96c329d8e 100755 --- a/t/pragma/sub_lval.t +++ b/t/pragma/sub_lval.t @@ -5,8 +5,8 @@ BEGIN { unshift @INC, '../lib'; } -sub a {use attrs 'lvalue'; my $a = 34; bless \$a} # Return a temporary -sub b {use attrs 'lvalue'; shift} +sub a : lvalue { my $a = 34; bless \$a } # Return a temporary +sub b : lvalue { shift } my $out = a(b()); # Check that temporaries are allowed. print "# `$out'\nnot " unless ref $out eq 'main'; # Not reached if error. @@ -20,8 +20,8 @@ my $in; # Check that we can return localized values from subroutines: -sub in {use attrs 'lvalue'; $in = shift;} -sub neg {use attrs 'lvalue'; #(num_str) return num_str +sub in : lvalue { $in = shift; } +sub neg : lvalue { #(num_str) return num_str local $_ = shift; s/^\+/-/; $_; @@ -32,11 +32,11 @@ in(neg("+2")); print "# `$in'\nnot " unless $in eq '-2'; print "ok 3\n"; -sub get_lex {use attrs 'lvalue'; $in} -sub get_st {use attrs 'lvalue'; $blah} -sub id {use attrs 'lvalue'; shift} -sub id1 {use attrs 'lvalue'; $_[0]} -sub inc {use attrs 'lvalue'; ++$_[0]} +sub get_lex : lvalue { $in } +sub get_st : lvalue { $blah } +sub id : lvalue { shift } +sub id1 : lvalue { $_[0] } +sub inc : lvalue { ++$_[0] } $in = 5; $blah = 3; @@ -139,9 +139,9 @@ $#c = 3; # These slots are not fillable. =for disabled constructs -sub a3 {use attrs 'lvalue'; @a} -sub b2 {use attrs 'lvalue'; @b} -sub c4 {use attrs 'lvalue'; @c} +sub a3 :lvalue {@a} +sub b2 : lvalue {@b} +sub c4: lvalue {@c} $_ = ''; @@ -162,7 +162,7 @@ print "ok 22\n"; my $var; -sub a::var {use attrs 'lvalue'; $var} +sub a::var : lvalue { $var } "a"->var = 45; @@ -177,7 +177,7 @@ $o->var = 47; print "# `$var' ne 47\nnot " unless $var eq 47; print "ok 24\n"; -sub o {use attrs 'lvalue'; $o} +sub o : lvalue { $o } o->var = 49; @@ -242,7 +242,7 @@ print "# '$_', '$x0', '$x1'.\nnot " unless /Can\'t modify non-lvalue subroutine call/; print "ok 30\n"; -sub lv0 {use attrs 'lvalue';} # Converted to lv10 in scalar context +sub lv0 : lvalue { } # Converted to lv10 in scalar context $_ = undef; eval <<'EOE' or $_ = $@; @@ -254,7 +254,7 @@ print "# '$_'.\nnot " unless /Can\'t return a readonly value from lvalue subroutine/; print "ok 31\n"; -sub lv10 {use attrs 'lvalue';} +sub lv10 : lvalue {} $_ = undef; eval <<'EOE' or $_ = $@; @@ -265,7 +265,7 @@ EOE print "# '$_'.\nnot " if defined $_; print "ok 32\n"; -sub lv1u {use attrs 'lvalue'; undef } +sub lv1u :lvalue { undef } $_ = undef; eval <<'EOE' or $_ = $@; @@ -288,7 +288,7 @@ print "# '$_'.\nnot " print "ok 34\n"; $x = '1234567'; -sub lv1t {use attrs 'lvalue'; index $x, 2 } +sub lv1t : lvalue { index $x, 2 } $_ = undef; eval <<'EOE' or $_ = $@; @@ -312,7 +312,7 @@ print "ok 36\n"; $xxx = 'xxx'; sub xxx () { $xxx } # Not lvalue -sub lv1tmp {use attrs 'lvalue'; xxx } # is it a TEMP? +sub lv1tmp : lvalue { xxx } # is it a TEMP? $_ = undef; eval <<'EOE' or $_ = $@; @@ -335,7 +335,7 @@ print "# '$_'.\nnot " print "ok 38\n"; sub xxx () { 'xxx' } # Not lvalue -sub lv1tmpr {use attrs 'lvalue'; xxx } # is it a TEMP? +sub lv1tmpr : lvalue { xxx } # is it a TEMP? $_ = undef; eval <<'EOE' or $_ = $@; @@ -359,7 +359,7 @@ print "ok 40\n"; =for disabled constructs -sub lva {use attrs 'lvalue';@a} +sub lva : lvalue {@a} $_ = undef; @a = (); @@ -401,7 +401,7 @@ print "ok 43\n"; print "ok $_\n" for 41..43; -sub lv1n {use attrs 'lvalue'; $newvar } +sub lv1n : lvalue { $newvar } $_ = undef; eval <<'EOE' or $_ = $@; @@ -412,7 +412,7 @@ EOE print "# '$_', '$newvar'.\nnot " unless "'$newvar' $_" eq "'4' "; print "ok 44\n"; -sub lv1nn {use attrs 'lvalue'; $nnewvar } +sub lv1nn : lvalue { $nnewvar } $_ = undef; eval <<'EOE' or $_ = $@; diff --git a/t/pragma/utf8.t b/t/pragma/utf8.t index 01b0f0529c..2ae8d9c784 100755 --- a/t/pragma/utf8.t +++ b/t/pragma/utf8.t @@ -4,6 +4,10 @@ BEGIN { chdir 't' if -d 't'; unshift @INC, '../lib'; $ENV{PERL5LIB} = '../lib'; + if ( ord("\t") != 9 ) { # skip on ebcdic platforms + print "1..0 # Skip utf8 tests on ebcdic platform.\n"; + exit; + } } print "1..12\n"; diff --git a/t/pragma/warn/1global b/t/pragma/warn/1global index 836b7f513f..0af80221b2 100644 --- a/t/pragma/warn/1global +++ b/t/pragma/warn/1global @@ -43,7 +43,7 @@ EXPECT $^W = 1 ; my $b ; chop $b ; EXPECT -Use of uninitialized value at - line 4. +Use of uninitialized value in scalar chop at - line 4. ######## # warnings enabled at compile time, disabled at run time @@ -59,7 +59,7 @@ BEGIN { $^W = 0 } $^W = 1 ; my $b ; chop $b ; EXPECT -Use of uninitialized value at - line 5. +Use of uninitialized value in scalar chop at - line 5. ######## -w --FILE-- abcd @@ -68,7 +68,7 @@ my $b ; chop $b ; --FILE-- require "./abcd"; EXPECT -Use of uninitialized value at ./abcd line 1. +Use of uninitialized value in scalar chop at ./abcd line 1. ######## --FILE-- abcd @@ -78,7 +78,7 @@ my $b ; chop $b ; #! perl -w require "./abcd"; EXPECT -Use of uninitialized value at ./abcd line 1. +Use of uninitialized value in scalar chop at ./abcd line 1. ######## --FILE-- abcd @@ -88,7 +88,7 @@ my $b ; chop $b ; $^W =1 ; require "./abcd"; EXPECT -Use of uninitialized value at ./abcd line 1. +Use of uninitialized value in scalar chop at ./abcd line 1. ######## --FILE-- abcd @@ -110,28 +110,28 @@ $^W =0 ; require "./abcd"; my $b ; chop $b ; EXPECT -Use of uninitialized value at - line 3. +Use of uninitialized value in scalar chop at - line 3. ######## $^W = 1; eval 'my $b ; chop $b ;' ; print $@ ; EXPECT -Use of uninitialized value at (eval 1) line 1. +Use of uninitialized value in scalar chop at (eval 1) line 1. ######## eval '$^W = 1;' ; print $@ ; my $b ; chop $b ; EXPECT -Use of uninitialized value at - line 4. +Use of uninitialized value in scalar chop at - line 4. ######## eval {$^W = 1;} ; print $@ ; my $b ; chop $b ; EXPECT -Use of uninitialized value at - line 4. +Use of uninitialized value in scalar chop at - line 4. ######## { @@ -149,12 +149,12 @@ my $a ; chop $a ; } my $c ; chop $c ; EXPECT -Use of uninitialized value at - line 5. +Use of uninitialized value in scalar chop at - line 5. ######## -w -e undef EXPECT -Use of uninitialized value at - line 2. +Use of uninitialized value in -e at - line 2. ######## $^W = 1 + 2 ; @@ -186,4 +186,4 @@ sub fred { my $b ; chop $b ;} fred() ; } EXPECT -Use of uninitialized value at - line 2. +Use of uninitialized value in scalar chop at - line 2. diff --git a/t/pragma/warn/2use b/t/pragma/warn/2use index 4ec4da0a77..384b3b361e 100644 --- a/t/pragma/warn/2use +++ b/t/pragma/warn/2use @@ -42,7 +42,7 @@ use warnings 'uninitialized' ; } my $b ; chop $b ; EXPECT -Use of uninitialized value at - line 8. +Use of uninitialized value in scalar chop at - line 8. ######## # Check runtime scope of pragma @@ -53,7 +53,7 @@ no warnings ; } my $b ; chop $b ; EXPECT -Use of uninitialized value at - line 6. +Use of uninitialized value in scalar chop at - line 6. ######## # Check runtime scope of pragma @@ -64,7 +64,7 @@ no warnings ; } &$a ; EXPECT -Use of uninitialized value at - line 6. +Use of uninitialized value in scalar chop at - line 6. ######## use warnings 'deprecated' ; @@ -103,7 +103,7 @@ require "./abc"; my $a ; chop $a ; EXPECT Use of EQ is deprecated at ./abc line 2. -Use of uninitialized value at - line 3. +Use of uninitialized value in scalar chop at - line 3. ######## --FILE-- abc.pm @@ -116,7 +116,7 @@ use abc; my $a ; chop $a ; EXPECT Use of EQ is deprecated at abc.pm line 2. -Use of uninitialized value at - line 3. +Use of uninitialized value in scalar chop at - line 3. ######## # Check scope of pragma with eval @@ -137,7 +137,7 @@ eval { }; print STDERR $@ ; my $b ; chop $b ; EXPECT -Use of uninitialized value at - line 6. +Use of uninitialized value in scalar chop at - line 6. ######## # Check scope of pragma with eval @@ -147,8 +147,8 @@ eval { }; print STDERR $@ ; my $b ; chop $b ; EXPECT -Use of uninitialized value at - line 5. -Use of uninitialized value at - line 7. +Use of uninitialized value in scalar chop at - line 5. +Use of uninitialized value in scalar chop at - line 7. ######## # Check scope of pragma with eval @@ -159,7 +159,7 @@ eval { }; print STDERR $@ ; my $b ; chop $b ; EXPECT -Use of uninitialized value at - line 8. +Use of uninitialized value in scalar chop at - line 8. ######## # Check scope of pragma with eval @@ -223,7 +223,7 @@ eval q[ ]; print STDERR $@; my $b ; chop $b ; EXPECT -Use of uninitialized value at (eval 1) line 3. +Use of uninitialized value in scalar chop at (eval 1) line 3. ######## # Check scope of pragma with eval @@ -233,8 +233,8 @@ eval ' '; print STDERR $@ ; my $b ; chop $b ; EXPECT -Use of uninitialized value at (eval 1) line 2. -Use of uninitialized value at - line 7. +Use of uninitialized value in scalar chop at (eval 1) line 2. +Use of uninitialized value in scalar chop at - line 7. ######## # Check scope of pragma with eval @@ -245,7 +245,7 @@ eval ' '; print STDERR $@ ; my $b ; chop $b ; EXPECT -Use of uninitialized value at - line 8. +Use of uninitialized value in scalar chop at - line 8. ######## # Check scope of pragma with eval @@ -303,6 +303,6 @@ no warnings 'deprecated' ; 1 if $a EQ $b ; EXPECT Use of EQ is deprecated at - line 6. -Use of uninitialized value at - line 9. -Use of uninitialized value at - line 11. -Use of uninitialized value at - line 11. +Use of uninitialized value in scalar chop at - line 9. +Use of uninitialized value in string eq at - line 11. +Use of uninitialized value in string eq at - line 11. diff --git a/t/pragma/warn/3both b/t/pragma/warn/3both index 592724ad73..132b99b80f 100644 --- a/t/pragma/warn/3both +++ b/t/pragma/warn/3both @@ -13,7 +13,7 @@ sub fred { } EXPECT -Use of uninitialized value at - line 6. +Use of uninitialized value in scalar chop at - line 6. ######## # Check interaction of $^W and use warnings @@ -27,7 +27,7 @@ sub fred { } EXPECT -Use of uninitialized value at - line 6. +Use of uninitialized value in scalar chop at - line 6. ######## # Check interaction of $^W and use warnings @@ -64,7 +64,7 @@ $^W = 1 ; my $b ; chop $b ; EXPECT -Use of uninitialized value at - line 6. +Use of uninitialized value in scalar chop at - line 6. ######## # Check interaction of $^W and use warnings @@ -73,7 +73,7 @@ use warnings ; my $b ; chop $b ; EXPECT -Use of uninitialized value at - line 6. +Use of uninitialized value in scalar chop at - line 6. ######## # Check interaction of $^W and use warnings @@ -107,7 +107,7 @@ use warnings ; my $b ; chop $b ; EXPECT -Use of uninitialized value at - line 5. +Use of uninitialized value in scalar chop at - line 5. ######## # Check interaction of $^W and use warnings @@ -119,7 +119,7 @@ sub fred { BEGIN { $^W = 0 } fred() ; EXPECT -Use of uninitialized value at - line 6. +Use of uninitialized value in scalar chop at - line 6. ######## # Check interaction of $^W and use warnings @@ -141,7 +141,7 @@ BEGIN { $^W = 1 } my $b ; chop $b ; EXPECT -Use of uninitialized value at - line 6. +Use of uninitialized value in scalar chop at - line 6. ######## # Check interaction of $^W and use warnings @@ -150,7 +150,7 @@ use warnings ; my $b ; chop $b ; EXPECT -Use of uninitialized value at - line 6. +Use of uninitialized value in scalar chop at - line 6. ######## # Check interaction of $^W and use warnings @@ -181,7 +181,7 @@ BEGIN { $^W = 1 } my $b ; chop $b ; EXPECT -Use of uninitialized value at - line 10. +Use of uninitialized value in scalar chop at - line 10. ######## # Check interaction of $^W and use warnings @@ -194,4 +194,4 @@ BEGIN { $^W = 0 } my $b ; chop $b ; EXPECT -Use of uninitialized value at - line 7. +Use of uninitialized value in scalar chop at - line 7. diff --git a/t/pragma/warn/4lint b/t/pragma/warn/4lint index 6a08409bb2..db54f31c7b 100644 --- a/t/pragma/warn/4lint +++ b/t/pragma/warn/4lint @@ -9,14 +9,14 @@ $a = 1 if $a EQ $b ; close STDIN ; print STDIN "abc" ; EXPECT Use of EQ is deprecated at - line 5. -print on closed filehandle main::STDIN at - line 6. +print() on closed filehandle main::STDIN at - line 6. ######## -W # lint: check runtime $^W is zapped $^W = 0 ; close STDIN ; print STDIN "abc" ; EXPECT -print on closed filehandle main::STDIN at - line 4. +print() on closed filehandle main::STDIN at - line 4. ######## -W # lint: check runtime $^W is zapped @@ -25,7 +25,7 @@ print on closed filehandle main::STDIN at - line 4. close STDIN ; print STDIN "abc" ; } EXPECT -print on closed filehandle main::STDIN at - line 5. +print() on closed filehandle main::STDIN at - line 5. ######## -W # lint: check "no warnings" is zapped @@ -35,7 +35,7 @@ $a = 1 if $a EQ $b ; close STDIN ; print STDIN "abc" ; EXPECT Use of EQ is deprecated at - line 5. -print on closed filehandle main::STDIN at - line 6. +print() on closed filehandle main::STDIN at - line 6. ######## -W # lint: check "no warnings" is zapped @@ -44,7 +44,7 @@ print on closed filehandle main::STDIN at - line 6. close STDIN ; print STDIN "abc" ; } EXPECT -print on closed filehandle main::STDIN at - line 5. +print() on closed filehandle main::STDIN at - line 5. ######## -Ww # lint: check combination of -w and -W @@ -53,7 +53,7 @@ print on closed filehandle main::STDIN at - line 5. close STDIN ; print STDIN "abc" ; } EXPECT -print on closed filehandle main::STDIN at - line 5. +print() on closed filehandle main::STDIN at - line 5. ######## -W --FILE-- abc.pm @@ -67,7 +67,7 @@ use abc; my $a ; chop $a ; EXPECT Use of EQ is deprecated at abc.pm line 3. -Use of uninitialized value at - line 3. +Use of uninitialized value in scalar chop at - line 3. ######## -W --FILE-- abc @@ -81,7 +81,7 @@ require "./abc"; my $a ; chop $a ; EXPECT Use of EQ is deprecated at ./abc line 3. -Use of uninitialized value at - line 3. +Use of uninitialized value in scalar chop at - line 3. ######## -W --FILE-- abc.pm @@ -95,7 +95,7 @@ use abc; my $a ; chop $a ; EXPECT Use of EQ is deprecated at abc.pm line 3. -Use of uninitialized value at - line 3. +Use of uninitialized value in scalar chop at - line 3. ######## -W --FILE-- abc @@ -109,4 +109,4 @@ require "./abc"; my $a ; chop $a ; EXPECT Use of EQ is deprecated at ./abc line 3. -Use of uninitialized value at - line 3. +Use of uninitialized value in scalar chop at - line 3. diff --git a/t/pragma/warn/7fatal b/t/pragma/warn/7fatal index fe94511f3e..943bb06fb3 100644 --- a/t/pragma/warn/7fatal +++ b/t/pragma/warn/7fatal @@ -23,7 +23,7 @@ use warnings FATAL => 'uninitialized' ; my $b ; chop $b ; print STDERR "The End.\n" ; EXPECT -Use of uninitialized value at - line 8. +Use of uninitialized value in scalar chop at - line 8. ######## # Check runtime scope of pragma @@ -35,7 +35,7 @@ no warnings ; &$a ; print STDERR "The End.\n" ; EXPECT -Use of uninitialized value at - line 6. +Use of uninitialized value in scalar chop at - line 6. ######## --FILE-- abc @@ -69,7 +69,7 @@ my $a ; chop $a ; print STDERR "The End.\n" ; EXPECT Use of EQ is deprecated at ./abc line 2. -Use of uninitialized value at - line 3. +Use of uninitialized value in scalar chop at - line 3. ######## --FILE-- abc.pm @@ -83,7 +83,7 @@ my $a ; chop $a ; print STDERR "The End.\n" ; EXPECT Use of EQ is deprecated at abc.pm line 2. -Use of uninitialized value at - line 3. +Use of uninitialized value in scalar chop at - line 3. ######## # Check scope of pragma with eval @@ -95,7 +95,7 @@ eval { my $b ; chop $b ; print STDERR "The End.\n" ; EXPECT --- Use of uninitialized value at - line 6. +-- Use of uninitialized value in scalar chop at - line 6. The End. ######## @@ -107,8 +107,8 @@ eval { my $b ; chop $b ; print STDERR "The End.\n" ; EXPECT --- Use of uninitialized value at - line 5. -Use of uninitialized value at - line 7. +-- Use of uninitialized value in scalar chop at - line 5. +Use of uninitialized value in scalar chop at - line 7. ######## # Check scope of pragma with eval @@ -120,7 +120,7 @@ eval { my $b ; chop $b ; print STDERR "The End.\n" ; EXPECT -Use of uninitialized value at - line 8. +Use of uninitialized value in scalar chop at - line 8. ######## # Check scope of pragma with eval @@ -178,7 +178,7 @@ eval q[ my $b ; chop $b ; print STDERR "The End.\n" ; EXPECT --- Use of uninitialized value at (eval 1) line 3. +-- Use of uninitialized value in scalar chop at (eval 1) line 3. The End. ######## @@ -190,8 +190,8 @@ eval ' my $b ; chop $b ; print STDERR "The End.\n" ; EXPECT --- Use of uninitialized value at (eval 1) line 2. -Use of uninitialized value at - line 7. +-- Use of uninitialized value in scalar chop at (eval 1) line 2. +Use of uninitialized value in scalar chop at - line 7. ######## # Check scope of pragma with eval @@ -203,7 +203,7 @@ eval ' my $b ; chop $b ; print STDERR "The End.\n" ; EXPECT -Use of uninitialized value at - line 8. +Use of uninitialized value in scalar chop at - line 8. ######## # Check scope of pragma with eval diff --git a/t/pragma/warn/doio b/t/pragma/warn/doio index 5101bdef80..57dd993a2b 100644 --- a/t/pragma/warn/doio +++ b/t/pragma/warn/doio @@ -1,6 +1,6 @@ doio.c - Can't do bidirectional pipe [Perl_do_open9] + Can't open bidirectional pipe [Perl_do_open9] open(F, "| true |"); Missing command in piped open [Perl_do_open9] @@ -64,7 +64,7 @@ no warnings 'io' ; open(G, '|'.($^O eq 'VMS' ? 'mcr ':'')."$^X -e 1|"); close(G); EXPECT -Can't do bidirectional pipe at - line 3. +Can't open bidirectional pipe at - line 3. ######## # doio.c [Perl_do_open9] use warnings 'io' ; @@ -123,7 +123,7 @@ print $a ; no warnings 'uninitialized' ; print $b ; EXPECT -Use of uninitialized value at - line 3. +Use of uninitialized value in print at - line 3. ######## # doio.c [Perl_my_stat Perl_my_lstat] use warnings 'io' ; diff --git a/t/pragma/warn/doop b/t/pragma/warn/doop index 961d157502..cce6bdc07c 100644 --- a/t/pragma/warn/doop +++ b/t/pragma/warn/doop @@ -12,6 +12,12 @@ EXPECT Malformed UTF-8 character at - line 4. ######## # 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" ; @@ -20,6 +26,6 @@ no warnings 'utf8' ; $_ = "\x80 \xff" ; chop ; EXPECT -\x80 will produce malformed UTF-8 character; use \x{80} for that at - line 4. -\xff will produce malformed UTF-8 character; use \x{ff} for that at - line 4. -Malformed UTF-8 character at - line 5. +\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. +Malformed UTF-8 character at - line 11. diff --git a/t/pragma/warn/op b/t/pragma/warn/op index 950c0c8ffd..9a278effe9 100644 --- a/t/pragma/warn/op +++ b/t/pragma/warn/op @@ -558,7 +558,7 @@ Useless use of a constant in void context at - line 3. Useless use of a constant in void context at - line 4. ######## # op.c -$ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3; # known scalar leak +BEGIN{ $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3; } # known scalar leak use warnings 'unsafe' ; my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ; @a =~ /abc/ ; diff --git a/t/pragma/warn/pp b/t/pragma/warn/pp index 48b5ec86b5..eb09e059ba 100644 --- a/t/pragma/warn/pp +++ b/t/pragma/warn/pp @@ -85,7 +85,7 @@ my $b = $$a; no warnings 'uninitialized' ; my $c = $$a; EXPECT -Use of uninitialized value at - line 4. +Use of uninitialized value in scalar dereference at - line 4. ######## # pp.c use warnings 'unsafe' ; @@ -112,6 +112,12 @@ EXPECT Malformed UTF-8 character at - line 4. ######## # 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" ; @@ -120,6 +126,6 @@ no warnings 'utf8' ; $_ = "\x80 \xff" ; reverse ; EXPECT -\x80 will produce malformed UTF-8 character; use \x{80} for that at - line 4. -\xff will produce malformed UTF-8 character; use \x{ff} for that at - line 4. -Malformed UTF-8 character at - line 5. +\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. +Malformed UTF-8 character at - line 11. diff --git a/t/pragma/warn/pp_ctl b/t/pragma/warn/pp_ctl index 70e6d60e8d..f61da1a8e1 100644 --- a/t/pragma/warn/pp_ctl +++ b/t/pragma/warn/pp_ctl @@ -126,7 +126,7 @@ no warnings 'unsafe' ; @b = sort { last } @a ; EXPECT Exiting pseudo-block via last at - line 4. -Can't "last" outside a block at - line 4. +Can't "last" outside a loop block at - line 4. ######## # pp_ctl.c use warnings 'unsafe' ; diff --git a/t/pragma/warn/pp_hot b/t/pragma/warn/pp_hot index 9a4b0a0708..7e19dc5c94 100644 --- a/t/pragma/warn/pp_hot +++ b/t/pragma/warn/pp_hot @@ -9,7 +9,7 @@ Filehandle %s opened only for output [pp_print] print <STDOUT> ; - print on closed filehandle %s [pp_print] + print() on closed filehandle %s [pp_print] close STDIN ; print STDIN "abc" ; uninitialized [pp_rv2av] @@ -30,7 +30,7 @@ glob failed (can't start child: %s) [Perl_do_readline] <<TODO - Read on closed filehandle %s [Perl_do_readline] + readline() on closed filehandle %s [Perl_do_readline] close STDIN ; $a = <STDIN>; glob failed (child exited with status %d%s) [Perl_do_readline] <<TODO @@ -86,7 +86,7 @@ print STDIN "anc"; no warnings 'closed' ; print STDIN "anc"; EXPECT -print on closed filehandle main::STDIN at - line 4. +print() on closed filehandle main::STDIN at - line 4. ######## # pp_hot.c [pp_rv2av] use warnings 'uninitialized' ; @@ -95,7 +95,7 @@ my @b = @$a; no warnings 'uninitialized' ; my @c = @$a; EXPECT -Use of uninitialized value at - line 4. +Use of uninitialized value in array dereference at - line 4. ######## # pp_hot.c [pp_rv2hv] use warnings 'uninitialized' ; @@ -104,7 +104,7 @@ my %b = %$a; no warnings 'uninitialized' ; my %c = %$a; EXPECT -Use of uninitialized value at - line 4. +Use of uninitialized value in hash dereference at - line 4. ######## # pp_hot.c [pp_aassign] use warnings 'unsafe' ; @@ -128,7 +128,7 @@ close STDIN ; $a = <STDIN> ; no warnings 'closed' ; $a = <STDIN> ; EXPECT -Read on closed filehandle main::STDIN at - line 3. +readline() on closed filehandle main::STDIN at - line 3. ######## # pp_hot.c [Perl_do_readline] use warnings 'io' ; diff --git a/t/pragma/warn/pp_sys b/t/pragma/warn/pp_sys index 651cdf9515..ea4b536842 100644 --- a/t/pragma/warn/pp_sys +++ b/t/pragma/warn/pp_sys @@ -8,7 +8,7 @@ . write STDIN; - Write on closed filehandle %s [pp_leavewrite] + write() on closed filehandle %s [pp_leavewrite] format STDIN = . close STDIN; @@ -23,45 +23,47 @@ $a = "abc"; printf $a "fred" - printf on closed filehandle %s [pp_prtf] + printf() on closed filehandle %s [pp_prtf] close STDIN ; printf STDIN "fred" - Syswrite on closed filehandle [pp_send] + syswrite() on closed filehandle [pp_send] close STDIN; syswrite STDIN, "fred", 1; - Send on closed socket [pp_send] + send() on closed socket [pp_send] close STDIN; send STDIN, "fred", 1 - bind() on closed fd [pp_bind] + bind() on closed socket [pp_bind] close STDIN; bind STDIN, "fred" ; - connect() on closed fd [pp_connect] + connect() on closed socket [pp_connect] close STDIN; connect STDIN, "fred" ; - listen() on closed fd [pp_listen] + listen() on closed socket [pp_listen] close STDIN; listen STDIN, 2; - accept() on closed fd [pp_accept] + accept() on closed socket [pp_accept] close STDIN; accept STDIN, "fred" ; - shutdown() on closed fd [pp_shutdown] + shutdown() on closed socket [pp_shutdown] close STDIN; shutdown STDIN, 0; - [gs]etsockopt() on closed fd [pp_ssockopt] + setsockopt() on closed socket [pp_ssockopt] + getsockopt() on closed socket [pp_ssockopt] close STDIN; setsockopt STDIN, 1,2,3; getsockopt STDIN, 1,2; - get{sock, peer}name() on closed fd [pp_getpeername] + getsockname() on closed socket [pp_getpeername] + getpeername() on closed socket [pp_getpeername] close STDIN; getsockname STDIN; getpeername STDIN; @@ -112,7 +114,7 @@ write STDIN; no warnings 'closed' ; write STDIN; EXPECT -Write on closed filehandle main::STDIN at - line 6. +write() on closed filehandle main::STDIN at - line 6. ######## # pp_sys.c [pp_leavewrite] use warnings 'io' ; @@ -148,7 +150,7 @@ printf STDIN "fred"; no warnings 'closed' ; printf STDIN "fred"; EXPECT -printf on closed filehandle main::STDIN at - line 4. +printf() on closed filehandle main::STDIN at - line 4. ######## # pp_sys.c [pp_prtf] use warnings 'io' ; @@ -165,7 +167,7 @@ syswrite STDIN, "fred", 1; no warnings 'closed' ; syswrite STDIN, "fred", 1; EXPECT -Syswrite on closed filehandle at - line 4. +syswrite() on closed filehandle at - line 4. ######## # pp_sys.c [pp_prtf pp_send pp_bind pp_connect pp_listen pp_accept pp_shutdown pp_ssockopt ppp_getpeername] use warnings 'io' ; @@ -210,16 +212,16 @@ getsockopt STDIN, 1,2; getsockname STDIN; getpeername STDIN; EXPECT -Send on closed socket at - line 22. -bind() on closed fd at - line 23. -connect() on closed fd at - line 24. -listen() on closed fd at - line 25. -accept() on closed fd at - line 26. -shutdown() on closed fd at - line 27. -[gs]etsockopt() on closed fd at - line 28. -[gs]etsockopt() on closed fd at - line 29. -get{sock, peer}name() on closed fd at - line 30. -get{sock, peer}name() on closed fd at - line 31. +send() on closed socket at - line 22. +bind() on closed socket at - line 23. +connect() on closed socket at - line 24. +listen() on closed socket at - line 25. +accept() on closed socket at - line 26. +shutdown() on closed socket at - line 27. +setsockopt() on closed socket at - line 28. +getsockopt() on closed socket at - line 29. +getsockname() on closed socket at - line 30. +getpeername() on closed socket at - line 31. ######## # pp_sys.c [pp_stat] use warnings 'newline' ; diff --git a/t/pragma/warn/regcomp b/t/pragma/warn/regcomp index 9c3677ee10..bb208db6bd 100644 --- a/t/pragma/warn/regcomp +++ b/t/pragma/warn/regcomp @@ -15,8 +15,13 @@ Character class syntax [%c %c] belongs inside character classes [S_checkposixcc] + /%.127s/: false [] range \"%*.*s\" in regexp [S_regclass] - + /%.127s/: false [] range \"%*.*s\" in regexp [S_regclassutf8] + + /%.127s/: Unrecognized escape \\%c in character class passed through" [S_regclass] + + /%.127s/: Unrecognized escape \\%c in character class passed through" [S_regclassutf8] __END__ # regcomp.c [S_regpiece] @@ -39,8 +44,9 @@ Strange *+?{} on zero-length expression at - line 4. ######## # regcomp.c [S_regatom] use warnings 'unsafe' ; -$a =~ /\m/ ; +$a =~ /a\mb\b/ ; no warnings 'unsafe' ; +$a =~ /a\mb\b/ ; EXPECT Unrecognized escape \m passed through at - line 3. ######## @@ -62,6 +68,7 @@ no warnings 'unsafe' ; /[[.foo.]]/; /[[=bar=]]/; /[:zog:]/; +BEGIN { $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3 } /[[:zog:]]/; EXPECT Character class syntax [: :] belongs inside character classes at - line 4. @@ -72,4 +79,83 @@ Character class syntax [= =] is reserved for future extensions at - line 6. Character class syntax [. .] is reserved for future extensions at - line 8. Character class syntax [= =] is reserved for future extensions at - line 9. Character class syntax [: :] belongs inside character classes at - line 10. -Character class [:zog:] unknown at - line 19. +Character class [:zog:] unknown at - line 20. +######## +# regcomp.c [S_regclass] +$_ = ""; +use warnings 'unsafe' ; +/[a-b]/; +/[a-\d]/; +/[\d-b]/; +/[\s-\d]/; +/[\d-\s]/; +/[a-[:digit:]]/; +/[[:digit:]-b]/; +/[[:alpha:]-[:digit:]]/; +/[[:digit:]-[:alpha:]]/; +no warnings 'unsafe' ; +/[a-b]/; +/[a-\d]/; +/[\d-b]/; +/[\s-\d]/; +/[\d-\s]/; +/[a-[:digit:]]/; +/[[:digit:]-b]/; +/[[:alpha:]-[:digit:]]/; +/[[:digit:]-[:alpha:]]/; +EXPECT +/[a-\d]/: false [] range "a-\d" in regexp at - line 5. +/[\d-b]/: false [] range "\d-" in regexp at - line 6. +/[\s-\d]/: false [] range "\s-" in regexp at - line 7. +/[\d-\s]/: false [] range "\d-" in regexp at - line 8. +/[a-[:digit:]]/: false [] range "a-[:digit:]" in regexp at - line 9. +/[[:digit:]-b]/: false [] range "[:digit:]-" in regexp at - line 10. +/[[:alpha:]-[:digit:]]/: false [] range "[:alpha:]-" in regexp at - line 11. +/[[:digit:]-[:alpha:]]/: false [] range "[:digit:]-" in regexp at - line 12. +######## +# regcomp.c [S_regclassutf8] +BEGIN { + if (ord("\t") == 5) { + print "SKIPPED\n# ebcdic regular expression ranges differ."; + exit 0; + } +} +use utf8; +$_ = ""; +use warnings 'unsafe' ; +/[a-b]/; +/[a-\d]/; +/[\d-b]/; +/[\s-\d]/; +/[\d-\s]/; +/[a-[:digit:]]/; +/[[:digit:]-b]/; +/[[:alpha:]-[:digit:]]/; +/[[:digit:]-[:alpha:]]/; +no warnings 'unsafe' ; +/[a-b]/; +/[a-\d]/; +/[\d-b]/; +/[\s-\d]/; +/[\d-\s]/; +/[a-[:digit:]]/; +/[[:digit:]-b]/; +/[[:alpha:]-[:digit:]]/; +/[[:digit:]-[:alpha:]]/; +EXPECT +/[a-\d]/: false [] range "a-\d" in regexp at - line 12. +/[\d-b]/: false [] range "\d-" in regexp at - line 13. +/[\s-\d]/: false [] range "\s-" in regexp at - line 14. +/[\d-\s]/: false [] range "\d-" in regexp at - line 15. +/[a-[:digit:]]/: false [] range "a-[:digit:]" in regexp at - line 16. +/[[:digit:]-b]/: false [] range "[:digit:]-" in regexp at - line 17. +/[[:alpha:]-[:digit:]]/: false [] range "[:alpha:]-" in regexp at - line 18. +/[[:digit:]-[:alpha:]]/: false [] range "[:digit:]-" in regexp at - line 19. +######## +# regcomp.c [S_regclass S_regclassutf8] +use warnings 'unsafe' ; +$a =~ /[a\zb]/ ; +no warnings 'unsafe' ; +$a =~ /[a\zb]/ ; +EXPECT +/[a\zb]/: Unrecognized escape \z in character class passed through at - line 3. diff --git a/t/pragma/warn/sv b/t/pragma/warn/sv index c02ff01b82..97d61bca17 100644 --- a/t/pragma/warn/sv +++ b/t/pragma/warn/sv @@ -58,7 +58,7 @@ $x = 1 + $a[0] ; # a no warnings 'uninitialized' ; $x = 1 + $b[0] ; # a EXPECT -Use of uninitialized value at - line 4. +Use of uninitialized value in integer addition (+) at - line 4. ######## # sv.c (sv_2iv) package fred ; @@ -73,7 +73,7 @@ $A *= 2 ; no warnings 'uninitialized' ; $A *= 2 ; EXPECT -Use of uninitialized value at - line 10. +Use of uninitialized value in integer multiplication (*) at - line 10. ######## # sv.c use integer ; @@ -82,7 +82,7 @@ my $x *= 2 ; #b no warnings 'uninitialized' ; my $y *= 2 ; #b EXPECT -Use of uninitialized value at - line 4. +Use of uninitialized value in integer multiplication (*) at - line 4. ######## # sv.c (sv_2uv) package fred ; @@ -98,7 +98,7 @@ no warnings 'uninitialized' ; $B = 0 ; $B |= $A ; EXPECT -Use of uninitialized value at - line 10. +Use of uninitialized value in bitwise or (|) at - line 10. ######## # sv.c use warnings 'uninitialized' ; @@ -108,7 +108,7 @@ no warnings 'uninitialized' ; my $Y = 1 ; $x = 1 | $b[$Y] ; EXPECT -Use of uninitialized value at - line 4. +Use of uninitialized value in bitwise or (|) at - line 4. ######## # sv.c use warnings 'uninitialized' ; @@ -116,7 +116,7 @@ my $x *= 1 ; # d no warnings 'uninitialized' ; my $y *= 1 ; # d EXPECT -Use of uninitialized value at - line 3. +Use of uninitialized value in multiplication (*) at - line 3. ######## # sv.c use warnings 'uninitialized' ; @@ -124,7 +124,7 @@ $x = 1 + $a[0] ; # e no warnings 'uninitialized' ; $x = 1 + $b[0] ; # e EXPECT -Use of uninitialized value at - line 3. +Use of uninitialized value in addition (+) at - line 3. ######## # sv.c (sv_2nv) package fred ; @@ -138,7 +138,7 @@ $A *= 2 ; no warnings 'uninitialized' ; $A *= 2 ; EXPECT -Use of uninitialized value at - line 9. +Use of uninitialized value in multiplication (*) at - line 9. ######## # sv.c use warnings 'uninitialized' ; @@ -146,7 +146,7 @@ $x = $y + 1 ; # f no warnings 'uninitialized' ; $x = $z + 1 ; # f EXPECT -Use of uninitialized value at - line 3. +Use of uninitialized value in addition (+) at - line 3. ######## # sv.c use warnings 'uninitialized' ; @@ -162,7 +162,7 @@ $x = chop $y ; # h no warnings 'uninitialized' ; $x = chop $z ; # h EXPECT -Use of uninitialized value at - line 3. +Use of uninitialized value in scalar chop at - line 3. ######## # sv.c (sv_2pv) package fred ; @@ -178,7 +178,7 @@ no warnings 'uninitialized' ; $C = "" ; $C .= $A ; EXPECT -Use of uninitialized value at - line 10. +Use of uninitialized value in concatenation (.) at - line 10. ######## # sv.c use warnings 'numeric' ; @@ -269,6 +269,12 @@ 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 ; { @@ -279,9 +285,9 @@ $^W =0 ; } my $a = rindex "a\xff bc ", "bc" ; EXPECT -\xff will produce malformed UTF-8 character; use \x{ff} for that at - line 6. -Malformed UTF-8 character at - line 6. -Malformed UTF-8 character at - line 10. +\xff will produce malformed UTF-8 character; use \x{ff} for that at - line 12. +Malformed UTF-8 character at - line 12. +Malformed UTF-8 character at - line 16. ######## # sv.c use warnings 'misc'; diff --git a/t/pragma/warn/toke b/t/pragma/warn/toke index ee02efa813..515241ab4d 100644 --- a/t/pragma/warn/toke +++ b/t/pragma/warn/toke @@ -462,13 +462,19 @@ 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 4. +\xff will produce malformed UTF-8 character; use \x{ff} for that at - line 10. ######## # toke.c my $a = rand + 4 ; diff --git a/t/pragma/warn/utf8 b/t/pragma/warn/utf8 index b11514d826..19b8d1db3a 100644 --- a/t/pragma/warn/utf8 +++ b/t/pragma/warn/utf8 @@ -22,6 +22,12 @@ EXPECT Malformed UTF-8 character at - line 3. ######## # 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" ; { @@ -31,9 +37,9 @@ my $a = ord "\x80" ; my $a = ord "\x80" ; } EXPECT -Malformed UTF-8 character at - line 3. -\x80 will produce malformed UTF-8 character; use \x{80} for that at - line 6. -Malformed UTF-8 character at - line 6. +Malformed UTF-8 character at - line 9. +\x80 will produce malformed UTF-8 character; use \x{80} for that at - line 12. +Malformed UTF-8 character at - line 12. ######## # utf8.c [utf8_to_uv] use utf8 ; @@ -42,6 +48,12 @@ EXPECT Malformed UTF-8 character at - line 3. ######## # 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" ; { @@ -51,6 +63,6 @@ my $a = ord "\xf080" ; my $a = ord "\xf080" ; } EXPECT -Malformed UTF-8 character at - line 3. -\xf0 will produce malformed UTF-8 character; use \x{f0} for that at - line 6. -Malformed UTF-8 character at - line 6. +Malformed UTF-8 character at - line 9. +\xf0 will produce malformed UTF-8 character; use \x{f0} for that at - line 12. +Malformed UTF-8 character at - line 12. |