Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
workaround for nutty cygwin filesystem
  • Loading branch information
plicease committed Mar 2, 2016
1 parent 0f7fdb6 commit 6f718e5
Show file tree
Hide file tree
Showing 13 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions Changes
@@ -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)
Expand Down
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.
File renamed without changes.
7 changes: 4 additions & 3 deletions t/02_all.t
@@ -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
Expand Down
12 changes: 7 additions & 5 deletions t/03_simple.t
Expand Up @@ -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');
Expand All @@ -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
Expand All @@ -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' );
}

Expand All @@ -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(
Expand Down

0 comments on commit 6f718e5

Please sign in to comment.