skip_all_without_unicode_tables();
}
-plan (tests => 52);
+plan (tests => 55);
use utf8;
use open qw( :utf8 :std );
{
no warnings 'utf8';
+ local $SIG{__WARN__} = sub { }; # The eval will also output a warning,
+ # which we ignore
my $malformed_to_be = ($::IS_EBCDIC) # Overlong sequence
? "\x{74}\x{41}"
: "\x{c0}\x{a0}";
# was the wrong one, resulting in the lexer thinking we're still inside a
# quoted string and things getting freed multiple times.
#
-# \xe3\x80\xb0 are the utf8 bytes making up the character \x{3030}.
# The \x{3030} char isn't a legal var name, and this triggers the error.
#
# NB: this only failed if the closing quote of the interpolated string is
# the last char of the file (i.e. no trailing \n).
{
- no utf8;
-
- fresh_perl_is(qq{use utf8; "\$\xe3\x80\xb0"}, <<EOF, { stderr => 1},
-Wide character in print at - line 1.\
-syntax error at - line 1, near "\$\xe3\x80\xb0"
-Execution of - aborted due to compilation errors.
-EOF
- "RT# 124216");
+ my $bad = "\x{3030}";
+ # Write out the individual utf8 bytes making up \x{3030}. This
+ # avoids 'Wide char in print' warnings from test.pl. (We may still
+ # get that warning when compiling the prog itself, since the
+ # error it prints to stderr contains a wide char.)
+ utf8::encode($bad);
+
+ fresh_perl_like(qq{use utf8; "\$$bad"},
+ qr/
+ \A
+ ( \QWide character in print at - line 1.\E\n )?
+ \Qsyntax error at - line 1, near \E"\$.*"\n
+ \QExecution of - aborted due to compilation errors.\E\z
+ /xm,
+
+ {stderr => 1}, "RT# 124216");
}
+
+SKIP: { # [perl #128738]
+ use Config;
+ if ($Config{uvsize} < 8) {
+ skip("test is only valid on 64-bit ints", 2);
+ }
+ else {
+ no warnings 'deprecated';
+ my $a;
+ eval "\$a = q \x{ffffffff}Hello, \\\\whirled!\x{ffffffff}";
+ is $@, "",
+ "No errors in eval'ing a string with large code point delimiter";
+ is $a, 'Hello, \whirled!',
+ "Got expected result in eval'ing a string with a large code point"
+ . " delimiter";
+ }
+}
+
+
+# New tests go here ^^^^^
+
+# Keep this test last, as it will mess up line number reporting for any
+# subsequent tests.
+
+<<END;
+${
+#line 57
+qq ϟϟ }
+END
+is __LINE__, 59, '#line directive and qq with uni delims inside heredoc';
+
+# Put new tests above the line number tests.