summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2015-07-11 12:03:20 -0600
committerKarl Williamson <khw@cpan.org>2015-07-13 12:17:41 -0600
commit97bf8a2377185e29b65c2d10276fb50d0ad63d41 (patch)
treee8b74c1769e2204f2de9eba10b19c9cc1a0d302e
parente68670aedff308b76d0c1076a6073146840fb322 (diff)
downloadperl-97bf8a2377185e29b65c2d10276fb50d0ad63d41.tar.gz
uni/variables.t: Add TODO tests
These show a bug in perl parsing where utf8ness makes a difference. in what happens. In this case, a syntax error is accompanied by warning messages when in 'use utf8', and no warnings when not. I'm not filing a bug report, as I don't think it is worth fixing, as it is a syntax error after all. But I did make tests for it, as TODOs.
-rw-r--r--t/uni/variables.t11
1 files changed, 10 insertions, 1 deletions
diff --git a/t/uni/variables.t b/t/uni/variables.t
index e87e1f6de3..24e755a70b 100644
--- a/t/uni/variables.t
+++ b/t/uni/variables.t
@@ -136,6 +136,11 @@ for ( 0x0 .. 0xff ) {
like($@, qr/ syntax\ error | Unrecognized\ character /x,
"$name as a length-1 variable generates a syntax error");
$tests++;
+ utf8::upgrade($chr);
+ evalbytes "no strict; use utf8; \$$chr = 4;",
+ like($@, qr/ syntax\ error | Unrecognized\ character /x,
+ " ... and the same under 'use utf8'");
+ $tests++;
}
elsif ($ord < 32 || $chr =~ /[[:punct:][:digit:]]/a) {
@@ -243,7 +248,11 @@ for ( 0x0 .. 0xff ) {
splice @warnings, $i, 1 if $warnings[$i] =~ /is no longer supported/;
}
}
- if (! ok(@warnings == 0, " ... and doesn't generate any warnings")) {
+ my $message = " ... and doesn't generate any warnings";
+ $message = " TODO $message" if $ord == 0
+ || $chr =~ /\s/a;
+
+ if (! ok(@warnings == 0, $message)) {
note join "\n", @warnings;
}
$tests++;