diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-03-01 17:37:04 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-03-01 17:37:04 +0100 |
commit | e4995e57f3bd978f10585890c671c613f6531c2e (patch) | |
tree | b7b25d8bb913a4dffbadc5896ecb952a3b652981 /t | |
parent | 47f72633b8f571170718e2123c0e9066b4063d84 (diff) |
App::Dthumb::Data: Exactly preserve text files, add test for it
Diffstat (limited to 't')
-rwxr-xr-x | t/29-app-dthumb-data.t | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/t/29-app-dthumb-data.t b/t/29-app-dthumb-data.t new file mode 100755 index 0000000..42e9b41 --- /dev/null +++ b/t/29-app-dthumb-data.t @@ -0,0 +1,28 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use 5.010; +use autodie; + +use App::Dthumb::Data; +use Test::More; + +opendir(my $share, 'share'); +my @files = grep { /^[^.]/ } readdir($share); +closedir($share); + +plan( + tests => 1 + scalar @files, +); + +my $dthumb = App::Dthumb::Data->new(); + +isa_ok($dthumb, 'App::Dthumb::Data', 'App::Dthumb::Data->new()'); + +for my $file (@files) { + open(my $fh, '<', "share/${file}"); + my $data = do { local $/ = undef; <$fh> }; + close($fh); + + is($dthumb->get($file), $data, "\$dthumb->get($file)"); +} |