$| = 1;
-print "1..79\n";
+print "1..80\n";
use charnames ':full';
print "not " unless "\N{U+1D0C5}" eq "\N{BYZANTINE MUSICAL SYMBOL FTHORA SKLIRON CHROMA VASIS}";
print "ok 79\n";
+# [perl #73174] use of \N{FOO} used to reset %^H
+
+{
+ use charnames ":full";
+ my $res;
+ BEGIN { $^H{73174} = "foo" }
+ BEGIN { $res = ($^H{73174} // "") }
+ # forces loading of utf8.pm, which used to reset %^H
+ $res .= '-1' if ":" =~ /\N{COLON}/i;
+ BEGIN { $res .= '-' . ($^H{73174} // "") }
+ $res .= '-' . ($^H{73174} // "");
+ $res .= '-2' if ":" =~ /\N{COLON}/;
+ $res .= '-3' if ":" =~ /\N{COLON}/i;
+ print $res eq "foo-foo-1--2-3" ? "" : "not ",
+ "ok 80 - \$^H{foo} correct after /\\N{bar}/i (res=$res)\n";
+}
+
__END__
# unsupported pragma
use charnames ":scoobydoo";
@INC = '../lib';
-BEGIN { print "1..23\n"; }
+BEGIN { print "1..24\n"; }
BEGIN {
print "not " if exists $^H{foo};
print "ok 1 - \$^H{foo} doesn't exist initially\n";
print +($rf2 eq "z" ? "" : "not "), "ok 22 - \$^H{foo} correct after require\n";
}
+# [perl #73174]
+
+{
+ my $res;
+ BEGIN { $^H{73174} = "foo" }
+ BEGIN { $res = ($^H{73174} // "") }
+ "" =~ /\x{100}/i; # forces loading of utf8.pm, which used to reset %^H
+ BEGIN { $res .= '-' . ($^H{73174} // "")}
+ $res .= '-' . ($^H{73174} // "");
+ print $res eq "foo-foo-" ? "" : "not ",
+ "ok 23 - \$^H{foo} correct after /unicode/i (res=$res)\n";
+}
+
+
+
# Add new tests above this require, in case it fails.
require './test.pl';
stderr => 1
);
print "not " if length $result;
-print "ok 23 - double-freeing hints hash\n";
+print "ok 24 - double-freeing hints hash\n";
print "# got: $result\n" if length $result;
__END__
PUSHSTACKi(PERLSI_MAGIC);
ENTER;
- SAVEI32(PL_hints);
- PL_hints = 0;
+ SAVEHINTS();
save_re_context();
if (!gv_fetchmeth(stash, "SWASHNEW", 8, -1)) { /* demand load utf8 */
ENTER;