Can't get #17492 to work with -Uuseperlio otherwise (either
[p5sagit/p5-mst-13.2.git] / lib / FindBin.t
index d07ce75..80ac811 100755 (executable)
@@ -1,8 +1,8 @@
 #!./perl
 
 BEGIN {
-    chdir 't' if -d 't';
-    @INC = '../lib';
+    # Can't chdir in BEGIN before FindBin runs, as it then can't find us.
+    @INC = -d 't' ? 'lib' : '../lib';
 }
 
 print "1..1\n";
@@ -11,5 +11,9 @@ use FindBin qw($Bin);
 
 print "# $Bin\n";
 
-print "not " unless $Bin =~ m,[/.]lib\]?$,;
+if ($^O eq 'MacOS') {
+    print "not " unless $Bin =~ m,:lib:$,;
+} else {
+    print "not " unless $Bin =~ m,[/.]lib\]?$,;
+}
 print "ok 1\n";