diff options
author | dakkar <dakkar@luxion> | 2007-09-08 11:51:05 +0000 |
---|---|---|
committer | dakkar <dakkar@luxion> | 2007-09-08 11:51:05 +0000 |
commit | ca459459e37d29ff76a90cc457fb85f7d524b441 (patch) | |
tree | 7eeeaf65421c2564b77bff73d40adaa854678bd3 /t | |
parent | cache is now updated on 'put' (diff) | |
download | WebCoso-ca459459e37d29ff76a90cc457fb85f7d524b441.tar.gz WebCoso-ca459459e37d29ff76a90cc457fb85f7d524b441.tar.bz2 WebCoso-ca459459e37d29ff76a90cc457fb85f7d524b441.zip |
symlink following, and most parsers for the test
git-svn-id: svn://luxion/repos/WebCoso/trunk@284 fcb26f47-9200-0410-b104-b98ab5b095f3
Diffstat (limited to 't')
-rw-r--r-- | t/fcp-01.t | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -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)}, |