Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Some more CURL::File tests
  • Loading branch information
lizmat committed Jul 8, 2014
1 parent da034fd commit 3aa17a3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
19 changes: 14 additions & 5 deletions S22-package-format/local.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 11;
plan 21;

chdir 't/spec/S22-package-format';
my $cwd = $*CWD;
Expand All @@ -17,12 +17,21 @@ my $curlf2 = CompUnitRepo::Local::File.new(".");
isa_ok $curlf2, CompUnitRepo::Local::File;
ok $curlf1 === $curlf2, 'are they the same';

my $curlf3 = CompUnitRepo::Local::File.new("local");
my $compdir = 'localfile';
my $curlf3 = CompUnitRepo::Local::File.new($compdir);
isa_ok $curlf3, CompUnitRepo::Local::File;
ok $curlf2 !=== $curlf3, 'are they different';
isa_ok $curlf3.path, IO::Path;
is $curlf3.path, IO::Path.new("$cwd/local"), 'is "local" looking at the right dir';
is $curlf3.path, IO::Path.new("$cwd/$compdir"), "is '$compdir' looking at the right dir";

say $curlf3.candidates('Shazbat');
for False, True -> $no-precomp {
my $what = $no-precomp ?? ' with :no-precomp' !! '';
my $candidates = $curlf3.candidates('NanooNanoo',:$no-precomp);
ok $candidates ~~ Positional, "did we get a Positional$what";
is $candidates.elems, 1, "did we get 1 candidate$what";
isa_ok $candidates[0], CompUnit;

say $*CWD;
$candidates = $curlf3.candidates('Shazbat',:$no-precomp);
ok $candidates ~~ Positional, "did we get a Positional$what";
is $candidates.elems, 0, "did we get 0 candidates$what";
}
2 changes: 0 additions & 2 deletions S22-package-format/local/Shazbat.pm

This file was deleted.

3 changes: 3 additions & 0 deletions S22-package-format/localfile/NanooNanoo.pm
@@ -0,0 +1,3 @@
use v6;

class NanooNanoo { }

0 comments on commit 3aa17a3

Please sign in to comment.