This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add perldelta entry for 8a384d3a99 (ParseXS and locales).
[perl5.git] / t / op / lex.t
index 7601b95..b33f0ef 100644 (file)
@@ -2,9 +2,9 @@
 use strict;
 use warnings;
 
-require './test.pl';
+BEGIN { chdir 't'; require './test.pl'; }
 
-plan(tests => 7);
+plan(tests => 8);
 
 {
     no warnings 'deprecated';
@@ -45,13 +45,16 @@ curr_test(3);
 
 }
 
-fresh_perl_is(
+{
+ delete local $ENV{PERL_UNICODE};
+ fresh_perl_is(
   'BEGIN{ ++$_ for @INC{"charnames.pm","_charnames.pm"} } "\N{a}"',
   'Constant(\N{a}) unknown at - line 1, within string' . "\n"
  ."Execution of - aborted due to compilation errors.\n",
    { stderr => 1 },
   'correct output (and no crash) when charnames cannot load for \N{...}'
-);
+ );
+}
 fresh_perl_is(
   'BEGIN{ ++$_ for @INC{"charnames.pm","_charnames.pm"};
           $^H{charnames} = "foo" } "\N{a}"',
@@ -64,8 +67,24 @@ fresh_perl_is(
 fresh_perl_is(
   'BEGIN{ ++$_ for @INC{"charnames.pm","_charnames.pm"};
           $^H{charnames} = \"foo" } "\N{a}"',
-  'Constant(\N{a}) unknown at - line 1, within string' . "\n"
+  "Not a CODE reference at - line 2.\n"
+ ."Propagated at - line 2, within string\n"
  ."Execution of - aborted due to compilation errors.\n",
    { stderr => 1 },
   'no crash when charnames cannot load and %^H holds string reference'
 );
+
+# not fresh_perl_is, as it seems to hide the error
+is runperl(
+    nolib => 1, # -Ilib may also hide the error
+    progs => [
+      '*{',
+      '         XS::APItest::gv_fetchmeth_type()',
+      '}'
+    ],
+    stderr => 1,
+   ),
+  "Undefined subroutine &XS::APItest::gv_fetchmeth_type called at -e line "
+ ."2.\n",
+  'no buffer corruption with multiline *{...expr...}'
+;