From ca459459e37d29ff76a90cc457fb85f7d524b441 Mon Sep 17 00:00:00 2001 From: dakkar Date: Sat, 8 Sep 2007 11:51:05 +0000 Subject: symlink following, and most parsers for the test git-svn-id: svn://luxion/repos/WebCoso/trunk@284 fcb26f47-9200-0410-b104-b98ab5b095f3 --- t/fcp-01.t | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 't') 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)}, -- cgit v1.2.3