-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Understanding the power of the cache
- Loading branch information
Showing
4 changed files
with
19 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,6 @@ use nqp; | |
use CompUnit::PrecompilationRepository::Document; | ||
use File::Directory::Tree; | ||
|
||
plan 2; | ||
|
||
constant cache-name = "cache"; | ||
my $precomp-store = CompUnit::PrecompilationStore::File.new(prefix => | ||
cache-name.IO ); | ||
|
@@ -18,9 +16,16 @@ for <simple sub/simple> -> $doc-name { | |
my $handle = $precomp.load($key)[0]; | ||
my $precompiled-pod = nqp::atkey($handle.unit,'$=pod')[0]; | ||
is-deeply $precompiled-pod, $=pod[0], "Load precompiled pod $doc-name"; | ||
my @dirs = dir( "cache/", test => /ABCD/); | ||
is @dirs.elems, 1, "Cached dir created"; | ||
my $dir = @dirs[0] ~ "/" ~ $key.substr(0,2); | ||
ok $dir.IO.d, "Key directory created"; | ||
ok "$dir/$key".IO.f, "File cached"; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
JJ
Author
Collaborator
|
||
} | ||
|
||
rmtree(cache-name); | ||
#rmtree(cache-name); | ||
|
||
done-testing; | ||
|
||
=begin pod | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What is the purpose of these lines?
is bound to fail the test. The directory inside
cache/
will get a name like7710BE40DEE87AED4CAFCC5C2D350391227AD5E2
(a real example).Maybe you wanted to test the creation of the
cache
directory and not its contents?