This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #90160] U* gives ‘U0 mode on an empty string’
[perl5.git] / t / uni / cache.t
1 BEGIN {
2     chdir 't' if -d 't';
3     @INC = qw(../lib .);
4     require "test.pl";
5 }
6
7 plan tests => 1;
8
9 my $count = 0;
10 unshift @INC, sub {
11        # XXX Kludge requires exact path, which might change
12        $count++ if $_[1] eq 'unicore/lib/Sc/Hira.pl';
13 };
14
15 my $s = 'foo';
16
17 $s =~ m/[\p{Hiragana}]/;
18 $s =~ m/[\p{Hiragana}]/;
19 $s =~ m/[\p{Hiragana}]/;
20 $s =~ m/[\p{Hiragana}]/;
21
22 is($count, 1, "Swatch hash caching kept us from reloading swatch hash.");