File::Path::rmtree( 'ecmddir' );
}
-BEGIN {
- use Test::More tests => 41;
- use File::Spec;
-}
+use Test::More tests => 40;
+use File::Spec;
BEGIN {
# bad neighbor, but test_f() uses exit()
- *CORE::GLOBAL::exit = ''; # quiet 'only once' warning.
- *CORE::GLOBAL::exit = sub { return @_ };
+ *CORE::GLOBAL::exit = ''; # quiet 'only once' warning.
+ *CORE::GLOBAL::exit = sub (;$) { return $_[0] };
use_ok( 'ExtUtils::Command' );
}
is( scalar( $$out =~ s/use_ok\( 'ExtUtils::Command'//g), 2,
'concatenation worked' );
- # the truth value here is reversed -- Perl true is C false
- @ARGV = ( $Testfile );
- ok( test_f(), 'testing non-existent file' );
-
+ # the truth value here is reversed -- Perl true is shell false
@ARGV = ( $Testfile );
- cmp_ok( ! test_f(), '==', (-f $Testfile), 'testing non-existent file' );
+ is( test_f(), 1, 'testing non-existent file' );
# these are destructive, have to keep setting @ARGV
@ARGV = ( $Testfile );
touch();
@ARGV = ( $Testfile );
- ok( test_f(), 'now creating that file' );
+ is( test_f(), 0, 'testing touch() and test_f()' );
is_deeply( \@ARGV, [$Testfile], 'test_f preserves @ARGV' );
@ARGV = ( $Testfile );
$^O eq 'NetWare' || $^O eq 'dos' || $^O eq 'cygwin' ||
$^O eq 'MacOS'
) {
- skip( "different file permission semantics on $^O", 4);
+ skip( "different file permission semantics on $^O", 5);
}
@ARGV = ('testdir');
@ARGV = ('testdir');
rm_rf;
+ ok( ! -e 'testdir', 'rm_rf can delete a read-only dir' );
}
my $test_dir = File::Spec->join( 'ecmddir', 'temp2' );
@ARGV = ( $test_dir );
ok( ! -e $ARGV[0], 'temp directory not there yet' );
- ok( test_d(), 'testing non-existent directory' );
-
- @ARGV = ( $test_dir );
- cmp_ok( ! test_d(), '==', (-d $test_dir), 'testing non-existent dir' );
+ is( test_d(), 1, 'testing non-existent directory' );
@ARGV = ( $test_dir );
mkpath();
ok( -e $ARGV[0], 'temp directory created' );
- cmp_ok( test_d(), '==', (-d $test_dir), 'testing existing dir' );
+ is( test_d(), 0, 'testing existing dir' );
@ARGV = ( $test_dir );
# copy a file to a nested subdirectory
{
{ local @ARGV = 'd2utest'; mkpath; }
open(FILE, '>d2utest/foo');
+ binmode(FILE);
print FILE "stuff\015\012and thing\015\012";
close FILE;