--- t/fs.t 2007/07/09 22:44:20 25 +++ t/fs.t 2007/07/10 00:22:00 27 @@ -4,7 +4,7 @@ my $debug = shift @ARGV; -use Test::More tests => 744; +use Test::More tests => 766; use File::Slurp; use IO::File; @@ -127,6 +127,21 @@ ok( close($fh2), 'close 2' ); dump_debug 'closed'; + ok( symlink("$to/m", "$to/s"), 'symlink' ); + ok( -l "$to/s", 'is symlink' ); + ok( link("$to/m", "$to/l"), 'link' ); + cmp_ok( (stat("$to/l"))[3], '==', 2, 'l has 2 links' ); + cmp_ok( (stat("$to/m"))[3], '==', 2, 'm has 2 links' ); + + my $size = -s "$to/m"; + cmp_ok( length(read_file("$to/s")), '==', $size, "$to/s size $size" ); + cmp_ok( length(read_file("$to/l")), '==', $size, "$to/l size $size" ); + + ok( unlink("$to/s"), 'unlink s' ); + ok( ! -e "$to/s", 'gone' ); + ok( unlink("$to/l"), 'unlink l' ); + cmp_ok( (stat("$to/m"))[3], '==', 1, 'no links' ); + my @sizes; my $size = 65536; while ( $size > 1 ) { @@ -172,11 +187,9 @@ dump_debug 'hidden'; ok( print($fh1 "foobar"), "print to hidden" ); ok( close($fh1), "close $to/h" ); - diag $!; } } multiple_rw; multiple_rw; -