Skip to content

Commit

Permalink
Fix path for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniogamiz committed Oct 11, 2019
1 parent 4104583 commit 6866ce1
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions t/060-cache-ignore.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,31 @@ constant REP = 't/tmp/ref-ignore';
constant DOC = 't/tmp/doc-ignore';
constant IGNORE_FILE = ".cache-ignore";

mkdir DOC;
mkdir DOC.IO;

my Pod::To::Cached $cache;
diag 'Test .cache-ignore file';

create-pods("test1.pod6");
create-pods("test2.pod6");
DOC.IO.add('test1.pod6').spurt(q:to/CONTENT/);
=begin pod
=end pod
CONTENT

DOC.IO.add('test2.pod6').spurt(q:to/CONTENT/);
=begin pod
=end pod
CONTENT

#--MARKER-- Test 1
$cache .= new( :source( DOC ), :path( REP ), :verbose);
is-deeply $cache.get-pods.sort,
$cache .= new( :source( DOC ), :path( REP ), :!verbose);
is-deeply $cache.get-pods.sort,
("t/tmp/doc-ignore/test1.pod6",
"t/tmp/doc-ignore/test2.pod6"),
IGNORE_FILE ~ " does not exist";

#--MARKER-- Test 2
IGNORE_FILE.IO.spurt("");
$cache .= new( :source( DOC ), :path( REP ), :verbose);
$cache .= new( :source( DOC ), :path( REP ), :!verbose);
is-deeply $cache.get-pods.sort,
("t/tmp/doc-ignore/test1.pod6",
"t/tmp/doc-ignore/test2.pod6"),
Expand All @@ -35,21 +42,11 @@ unlink IGNORE_FILE;

#--MARKER-- Test 3
IGNORE_FILE.IO.spurt("test2");
$cache .= new( :source( DOC ), :path( REP ), :verbose);
is-deeply $cache.get-pods.sort,
$cache .= new( :source( DOC ), :path( REP ), :!verbose);
is-deeply $cache.get-pods.sort,
("t/tmp/doc-ignore/test1.pod6",),
IGNORE_FILE ~ " with simple regex";
unlink IGNORE_FILE;

rmtree REP;
rmtree DOC;

# helpers

sub create-pods($filename) {
(DOC ~ "/$filename").IO.spurt(q:to/POD-CONTENT/);
=begin pod
=TITLE More and more
=end pod
POD-CONTENT
}
rmtree DOC;

0 comments on commit 6866ce1

Please sign in to comment.