This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix assertion failure with $x[CONST->[0]]
[perl5.git] / t / comp / hints.t
index 391287c..0f52609 100644 (file)
@@ -4,7 +4,7 @@
 
 BEGIN {
     @INC = qw(. ../lib ../ext/re);
-    chdir 't';
+    chdir 't' if -d 't';
 }
 
 BEGIN { print "1..31\n"; }
@@ -122,7 +122,12 @@ BEGIN {
     my $res;
     BEGIN { $^H{73174} = "foo" }
     BEGIN { $res = ($^H{73174} // "") }
-    "" =~ /\x{100}/i;  # forces loading of utf8.pm, which used to reset %^H
+    # /x{100}/i forces loading of utf8.pm, which used to reset %^H
+    eval '"" =~ /\x{100}/i; 1'
+       # Allow miniperl to fail this regexp compilation (effectively skip
+       # the test) in case tables have not been build, but require real
+       # perl to succeed.
+       or defined &DynaLoader::boot_DynaLoader and die;        
     BEGIN { $res .= '-' . ($^H{73174} // "")}
     $res .= '-' . ($^H{73174} // "");
     print $res eq "foo-foo-" ? "" : "not ",