perl

 view release on metacpan or  search on metacpan

t/lib/warnings/toke  view on Meta::CPAN

# RT #4346 Case 2: Warnings for print (...)
use warnings;
print ("((\n");
print (">>\n")
EXPECT
print (...) interpreted as function at - line 3.
print (...) interpreted as function at - line 4.
((
>>
########
# RT #4346 Case 3: Warnings for print (...)
# TODO RT #4346: Warnings for print(...) are inconsistent
use warnings;
print (">>\n");
print ("((\n");
EXPECT
print (...) interpreted as function at - line 3.
print (...) interpreted as function at - line 4.
>>
((
########
# RT #4346 Case 4: Warnings for print (...)
# TODO RT #4346: Warnings for print(...) are inconsistent
use warnings;
print (")\n");
print ("))\n");
EXPECT
print (...) interpreted as function at - line 3.
print (...) interpreted as function at - line 4.
)
))
########
# NAME  Non-grapheme delimiters
BEGIN{
    if (ord('A') == 193) {
        print "SKIPPED\n# ebcdic platforms generates different Malformed UTF-8 warnings.";
        exit 0;
    }
}
use utf8;
my $a = qr ̂foobar̂;
EXPECT
Use of unassigned code point or non-standalone grapheme for a delimiter is not allowed at - line 8, near "= "
########
# NAME  [perl #130567] Assertion failure
BEGIN {
    if (ord('A') != 65) {
        print "SKIPPED\n# test is ASCII-specific";
        exit 0;
    }
}
no warnings "uninitialized";
$_= "";
s//\3000/;
s//"\x{180};;s\221(*$@$`\241\275";/gee;
s//"s\221\302\302\302\302\302\302\302$@\241\275";/gee;
EXPECT
########
# NAME  [perl #130666] Assertion failure
no warnings "uninitialized";
BEGIN{$^H=-1};my $l; s�$0[$l]��
EXPECT
########
# NAME  [perl #129036] Assertion failure
BEGIN{$0="";$^H=hex join""=>A00000}p?
EXPECT
OPTION fatal
syntax error at - line 1, at EOF
########
# NAME  [perl #130655]
use utf8;
qw∘foo ∞ ♥ bar∘
EXPECT
########
# NAME  [perl #134064]
BEGIN {
    if (ord('A') == 193) {
        print "SKIPPED\n# test is ASCII-specific, but could be extended to EBCDIC";
        exit 0;
    }
}
use utf8;
$foo="m'\302'";
eval $foo ;
print "The eval did not crash the program\n"
EXPECT
OPTION regex
Malformed UTF-8 character: .*non-continuation.*
The eval did not crash the program
########
# NAME [perl #133850] print $fh $1 in s///e expression
use warnings;
my $fh = \*STDOUT;
$_ = "abc";
s/(x)/ print $fh $1 /e;
EXPECT
########
# NAME [perl #133850] side case
use warnings;
my $fh = \*STDOUT;
my $y = "";
my $x = "${print $fh $y; \'x'}";
EXPECT
########
# NAME [perl #133850] another case
use warnings;
my $time = 1;
$_ = "";
s/^/ ${time} /e
EXPECT
Ambiguous use of ${time} resolved to $time at - line 4.
########
# NAME [perl #133850] another case
use warnings;
%x = qw(a b c d);
$_ = "";
s/^/ @x {a} /e
EXPECT
Scalar value @x{"a"} better written as $x{"a"} at - line 4.
########
# NAME Warn on 32-bit code points



( run in 7.071 seconds using v1.01-cache-2.11-cpan-b301d465b3d )