From 691135482762ce9dc9654f3848979dfe881cceb5 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Wed, 27 Oct 2010 22:54:59 -0600 Subject: [PATCH] File::CheckTree.t: @INC should be change for chdir This test has a workaround for windows that isn't needed if it just sets up the @INC initially to allow for finding things both before and after the chdir. And, it's unreasonable to expect that nothing it calls would in turn never do their own module load, so the @INC needs to be correct anyway. --- lib/File/CheckTree.t | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/lib/File/CheckTree.t b/lib/File/CheckTree.t index 656154a..1548a0f 100644 --- a/lib/File/CheckTree.t +++ b/lib/File/CheckTree.t @@ -2,23 +2,17 @@ BEGIN { chdir 't' if -d 't'; - @INC = '../lib'; + + # We will shortly chdir .., so '../lib' will be wrong at that time, and + # 'lib' will be correct + @INC = ('../lib', 'lib'); } use Test::More tests => 23; use strict; -BEGIN { -# Cwd::cwd does an implicit "require Win32", but -# the ../lib directory in @INC will no longer work once -# we chdir() out of the "t" directory. - if ($^O eq 'MSWin32') { - require Win32; - Win32->import(); - } - require overload; -} +require overload; use File::CheckTree; use File::Spec; # used to get absolute paths -- 2.7.4