Permalink
Browse files

workaround for nutty cygwin filesystem

  • Loading branch information...
plicease committed Mar 2, 2016
1 parent 0f7fdb6 commit 6f718e5f2510a1f62a1b5ec9107c52a3ab6e05ed
@@ -1,6 +1,7 @@
Revision history for {{$dist->name}}
{{$NEXT}}
- Workaround for nutty cygwin filesystem rules
1.20 2016-03-01 15:06:54 -0500
- Fix bug where executable named "0" would not be found (gh#7)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,16 +1,17 @@
use strict;
use warnings;
use Env qw( @PATH );
use Test::More tests => 6;
use File::Spec ();
use File::Which qw(which where);
# Where is the test application
my $test_bin = File::Spec->catdir( 't', 'test-bin' );
my $test_bin = File::Spec->catdir( 'corpus', $^O =~ /^(MSWin32|dos|os2)$/ ? 'test-bin-win' : 'test-bin-unix' );
ok( -d $test_bin, 'Found test-bin' );
# Set up for running the test application
local $ENV{PATH} = $test_bin;
@PATH = ($test_bin);
push @PATH, File::Spec->catdir( 'corpus', 'test-bin-win' ) if $^O eq 'cygwin';
unless (
File::Which::IS_VMS
or
@@ -3,6 +3,7 @@ use warnings;
use Test::More tests => 10;
use File::Spec ();
use File::Which qw{which where};
use Env qw( @PATH );
use constant IS_VMS => ($^O eq 'VMS');
use constant IS_MAC => ($^O eq 'MacOS');
@@ -20,11 +21,12 @@ is(
);
# Where is the test application
my $test_bin = File::Spec->catdir( 't', 'test-bin' );
my $test_bin = File::Spec->catdir( 'corpus', IS_DOS ? 'test-bin-win' : 'test-bin-unix' );
ok( -d $test_bin, 'Found test-bin' );
# Set up for running the test application
local $ENV{PATH} = $test_bin;
@PATH = $test_bin;
push @PATH, File::Spec->catdir( 'corpus', 'test-bin-win' ) if IS_CYGWIN;
unless (
File::Which::IS_VMS
or
@@ -38,8 +40,8 @@ unless (
SKIP: {
skip("Not on DOS-like filesystem", 3) unless IS_DOS;
is( lc scalar which('test1'), 't\test-bin\test1.exe', 'Looking for test1.exe' );
is( lc scalar which('test2'), 't\test-bin\test2.bat', 'Looking for test2.bat' );
is( lc scalar which('test1'), 'corpus\test-bin-win\test1.exe', 'Looking for test1.exe' );
is( lc scalar which('test2'), 'corpus\test-bin-win\test2.bat', 'Looking for test2.bat' );
is( scalar which('test3'), undef, 'test3 returns undef' );
}
@@ -60,7 +62,7 @@ SKIP: {
# Cygwin: should make test1.exe transparent
is(
scalar(which('test1')),
File::Spec->catfile( $test_bin, 'test1' ),
File::Spec->catfile( 'corpus', 'test-bin-win', 'test1' ),
'Looking for test1 on Cygwin: transparent to test1.exe',
);
is(

0 comments on commit 6f718e5

Please sign in to comment.