X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2Fio_tell.t;h=65c63bdfc9cbb501be2bfe68b6823af9cb120266;hb=9ee2bb1a7c54b1866ff07ab9c157254810ee5205;hp=5a706fb876dc5c1664477e63b233211718a35793;hpb=43cc1d52f97c5f21f3207f045444707e7be33927;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/lib/io_tell.t b/t/lib/io_tell.t index 5a706fb..65c63bd 100755 --- a/t/lib/io_tell.t +++ b/t/lib/io_tell.t @@ -1,14 +1,24 @@ #!./perl -# $RCSfile: tell.t,v $$Revision: 1.1 $$Date: 1996/05/01 10:52:47 $ +BEGIN { + unless(grep /blib/, @INC) { + chdir 't' if -d 't'; + @INC = '../lib'; + $tell_file = "TEST"; + } + else { + $tell_file = "Makefile"; + } +} + +use Config; BEGIN { - chdir 't' if -d 't'; - @INC = '../lib' if -d '../lib'; - require Config; import Config; - if ($Config{'extensions'} !~ /\bIO\b/ && !($^O eq 'VMS')) { - print "1..0\n"; - exit 0; + if(-d "lib" && -f "TEST") { + if ($Config{'extensions'} !~ /\bIO\b/ && $^O ne 'VMS') { + print "1..0\n"; + exit 0; + } } } @@ -16,8 +26,8 @@ print "1..13\n"; use IO::File; -$tst = IO::File->new("TEST","r") || die("Can't open TEST"); - +$tst = IO::File->new("$tell_file","r") || die("Can't open $tell_file"); +binmode $tst; # its a nop unless it matters. Was only if ($^O eq 'MSWin32' or $^O eq 'dos'); if ($tst->eof) { print "not ok 1\n"; } else { print "ok 1\n"; } $firstline = <$tst>;