Use prepared statement from the start for populate on PostgreSQL
[dbsrgits/DBIx-Class.git] / t / 54taint.t
index cfcde43..fbf0286 100644 (file)
@@ -1,3 +1,5 @@
+BEGIN { $ENV{DBICTEST_ANFANG_DEFANG} = 1 }
+
 use strict;
 use warnings;
 use Config;
@@ -6,16 +8,24 @@ use Config;
 # doesn't work. We don't want to have the user deal with that.
 BEGIN { unless ($INC{'t/lib/DBICTest/WithTaint.pm'}) {
 
+  if ( $^O eq 'MSWin32' and $^X =~ /\x20/ ) {
+    print "1..0 # SKIP Running this test on Windows with spaces within the perl executable path (\$^X) is not possible due to https://rt.perl.org/Ticket/Display.html?id=123907\n";
+    exit 0;
+  }
+
   # it is possible the test itself is initially invoked in taint mode
   # and with relative paths *and* with a relative $^X and some other
   # craziness... in short: just be proactive
   require File::Spec;
-  $ENV{PATH} = join $Config{path_sep},
-    map { length($_) ? File::Spec->rel2abs($_) : () }
-      split /\Q$Config{path_sep}/, $ENV{PATH}
-  ;
-  my $perl = $^X;
-  ($_) = $_ =~ /\A(.+)\z/ for ( $ENV{PATH}, $perl );
+
+  if (length $ENV{PATH}) {
+    ( $ENV{PATH} ) = join ( $Config{path_sep},
+      map { length($_) ? File::Spec->rel2abs($_) : () }
+        split /\Q$Config{path_sep}/, $ENV{PATH}
+    ) =~ /\A(.+)\z/;
+  }
+
+  my ($perl) = $^X =~ /\A(.+)\z/;
 
   {
     local $ENV{PATH} = "/nosuchrootbindir";
@@ -63,7 +73,7 @@ throws_ok (
   sub { $ENV{PATH} . (kill (0)) },
   qr/Insecure dependency in kill/,
   'taint mode active'
-);
+) if length $ENV{PATH};
 
 {
   package DBICTest::Taint::Classes;