BEGIN {
chdir 't' if -d 't';
- @INC = qw(../lib);
+ require './test.pl';
+ set_up_inc('../lib');
}
use strict;
any_tainted @_;
}
-require './test.pl';
-plan(tests => 3*10 + 3*8 + 2*16 + 2);
+plan(tests => 3*10 + 3*8 + 2*16 + 3);
my $arg = $ENV{PATH}; # a tainted value
use constant UTF8 => "\x{1234}";
is(tainted($taint), tainted($arg), "tainted: $encode, downgrade down");
}
-{
+SKIP: {
+ if (is_miniperl()) {
+ skip_if_miniperl("Unicode tables not built yet", 2)
+ unless eval 'require "unicore/Heavy.pl"';
+ }
fresh_perl_is('$a = substr $^X, 0, 0; /\x{100}/i; /$a\x{100}/i || print q,ok,',
'ok', {switches => ["-T", "-l"]},
"matching a regexp is taint agnostic");
'ok', {switches => ["-T", "-l"]},
"therefore swash_init should be taint agnostic");
}
+
+{
+ # RT #122148: s///e on tainted utf8 strings got pos() messed up in 5.20
+
+ my @p;
+ my $s = "\x{100}\x{100}\x{100}\x{100}". $^X;
+ $s =~ s/\x{100}/push @p, pos($s); "xxxx";/eg;
+ is("@p", "0 1 2 3", "RT #122148");
+}