Skip to content

Commit 387088a

Browse files
committed
Adds more low-level tests refs #5
1 parent e7a5b49 commit 387088a

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

t/007-load-precompile.t

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,25 @@ use File::Directory::Tree;
77

88
plan 1;
99

10-
my $precomp-store = CompUnit::PrecompilationStore::File.new(prefix => "cache".IO );
10+
constant cache-name = "cache";
11+
my $precomp-store = CompUnit::PrecompilationStore::File.new(prefix =>
12+
cache-name.IO );
1113
my $precomp = CompUnit::PrecompilationRepository::Document.new(store => $precomp-store);
1214

13-
constant doc-name = "simple";
14-
my $key = nqp::sha1(doc-name);
15-
$precomp.precompile(("t/doctest/" ~ doc-name ~ ".pod6").IO, $key, :force );
16-
my $handle = $precomp.load($key)[0];
17-
my $precompiled-pod = nqp::atkey($handle.unit,'$=pod')[0];
15+
for <simple sub/simple> -> $doc-name {
16+
my $key = nqp::sha1($doc-name);
17+
$precomp.precompile("t/doctest/$doc-name.pod6".IO, $key, :force );
18+
my $handle = $precomp.load($key)[0];
19+
my $precompiled-pod = nqp::atkey($handle.unit,'$=pod')[0];
20+
is-deeply $precompiled-pod, $=pod[0], "Load precompiled pod";
21+
}
1822

19-
#--MARKER-- Test 1
20-
is-deeply $precompiled-pod, $=pod[0], "Load precompiled pod";
21-
22-
rmtree("cache");
23+
rmtree(cache-name);
2324

2425
=begin pod
2526
26-
=TITLE powerfull cache
27+
=TITLE Powerful cache
2728
2829
Perl6 is quite awesome.
2930
30-
=end pod
31+
=end pod

t/doctest/simple.pod6

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
=begin pod
22
3-
=TITLE powerfull cache
3+
=TITLE Powerful cache
44
55
Perl6 is quite awesome.
66
7-
=end pod
7+
=end pod

t/doctest/sub/simple.pod6

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
=begin pod
2+
3+
=TITLE Powerful cache
4+
5+
Perl6 is quite awesome.
6+
7+
=end pod

0 commit comments

Comments
 (0)