This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Get t/uni/cache.t working under minitest
[perl5.git] / t / uni / cache.t
CommitLineData
c49d5ed7
JS
1BEGIN {
2 chdir 't' if -d 't';
f2b25aae
FC
3 require './test.pl';
4 @INC = () unless is_miniperl();
5 unshift @INC, '../lib';
c49d5ed7
JS
6}
7
8plan tests => 1;
9
90412e3e
KW
10# Looks to see if a "do 'unicore/lib/Sc/Hira.pl'" is called more than once, by
11# putting a compile sub first on the libary path;
12# XXX Kludge: requires exact path, which might change, and has deep knowledge
13# of how utf8_heavy.pl works, which might also change.
14
15BEGIN { # Make sure catches compile time references
16 $::count = 0;
17 unshift @INC, sub {
18 $::count++ if $_[1] eq 'unicore/lib/Sc/Hira.pl';
19 };
20}
c49d5ed7
JS
21
22my $s = 'foo';
23
88d45d28
KW
24# The second value is to prevent an optimization that exists at the time this
25# is written to re-use a property without trying to look it up if it is the
26# only thing in a character class. They differ in order to make sure that any
27# future optimizations that don't re-use identical character classes don't come
28# into play
29$s =~ m/[\p{Hiragana}\x{101}]/;
30$s =~ m/[\p{Hiragana}\x{102}]/;
31$s =~ m/[\p{Hiragana}\x{103}]/;
32$s =~ m/[\p{Hiragana}\x{104}]/;
c49d5ed7 33
90412e3e 34is($::count, 1, "Swatch hash caching kept us from reloading swatch hash.");