aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/fcp-01.t18
1 files changed, 17 insertions, 1 deletions
diff --git a/t/fcp-01.t b/t/fcp-01.t
index a745de2..49a2d66 100644
--- a/t/fcp-01.t
+++ b/t/fcp-01.t
@@ -44,6 +44,22 @@ is($fc->get($test_file->stringify),
is($fc->get($test_file),
$test_contents,
'cache ok 2');
+
+my $fc_l=File::Cache::Parsed->new(follow=>1);
+$fc_l->add_parser(qr{\.t$} => sub { return ['t',@_] });
+
+$fc->add_parser(qr{\.t$} => sub { return ['t',@_] });
+
+my $link_file=$base->file('symlink.t');
+symlink $test_file->stringify,$link_file->stringify;
+END { $link_file->remove }
+
+is_deeply($fc_l->get($link_file->stringify),
+ ['t',$test_file->absolute->stringify,$test_contents],
+ 'followed symlink');
+is_deeply($fc->get($link_file->stringify),
+ ['t',$link_file->stringify,$test_contents],
+ q{didn't follow symlink});
}
{
@@ -70,7 +86,7 @@ my $wr_file=file("$wr_tfile");
my $wr_contents="something\nor\nother\n";
$fc->put($wr_file->stringify,$wr_contents);
-is($calls{stuff},2,'defaulh writer');
+is($calls{stuff},2,'default writer');
is($wr_file->slurp,$wr_contents,'written ok passthrough');
$wr_contents={bad=>'stuff'};
throws_ok(sub {$fc->put($wr_file->stringify,$wr_contents)},