diff options
-rw-r--r-- | t/uni/cache.t | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/t/uni/cache.t b/t/uni/cache.t index df12f33ba2..74ce1f084a 100644 --- a/t/uni/cache.t +++ b/t/uni/cache.t @@ -6,11 +6,17 @@ BEGIN { plan tests => 1; -my $count = 0; -unshift @INC, sub { - # XXX Kludge requires exact path, which might change - $count++ if $_[1] eq 'unicore/lib/Sc/Hira.pl'; -}; +# Looks to see if a "do 'unicore/lib/Sc/Hira.pl'" is called more than once, by +# putting a compile sub first on the libary path; +# XXX Kludge: requires exact path, which might change, and has deep knowledge +# of how utf8_heavy.pl works, which might also change. + +BEGIN { # Make sure catches compile time references + $::count = 0; + unshift @INC, sub { + $::count++ if $_[1] eq 'unicore/lib/Sc/Hira.pl'; + }; +} my $s = 'foo'; @@ -19,4 +25,4 @@ $s =~ m/[\p{Hiragana}]/; $s =~ m/[\p{Hiragana}]/; $s =~ m/[\p{Hiragana}]/; -is($count, 1, "Swatch hash caching kept us from reloading swatch hash."); +is($::count, 1, "Swatch hash caching kept us from reloading swatch hash."); |