--- t/fs.t 2007/07/08 21:03:26 10 +++ t/fs.t 2007/07/09 08:39:58 11 @@ -4,7 +4,7 @@ my $debug = shift @ARGV; -use Test::More tests => 135; +use Test::More tests => 115; use File::Slurp; my ( $from, $to, $tmp ) = ( '/tmp/comp', '/tmp/no-comp', '/dev/shm/comp' ); @@ -19,17 +19,27 @@ if ( $op =~ m/>/ ) { print $fh $content; } else { + my $orig_content = $content; local $/; $content = <$fh>; - ok( $content, 'has content' ); + if ( defined( $content ) ) { + cmp_ok( $content, 'eq', $orig_content, 'content' ); + } else { + ok( $content, 'has content' ); + } } ok( close($fh), 'close' ); ok ( -e "$to/$path", 'exists' ); - ok( -e "$from/$path" || -e "$from/${path}.gz", 'on disk' ); + my $pack = "$from/${path}.gz"; - ok( -e "$tmp/$path" , 'in tmp' ) if ( $op =~ m/', $file, $content ); - cmp_ok( file( '<', $file ), 'eq', $content, "$file content" ); + file( '<', $file, $content ); file( '>>', $file, '+append' ); - cmp_ok( file( '<', $file ), 'eq', $content . '+append', "$file append" ); + file( '<', $file, $content . '+append' ); file( '>', $file, '' ); - cmp_ok( file( '<', $file ), 'eq', '', "$file empty" ); + file( '<', $file, '' ); file( '>', $file, $content ); - cmp_ok( file( '<', $file ), 'eq', $content, "$file content" ); + file( '<', $file, $content ); }