From: Rafael Kitover <rkitover@cpan.org>
Date: Tue, 19 Jul 2011 14:13:37 +0000 (-0400)
Subject: fix a couple test failures on Win32
X-Git-Tag: v0.08194~4
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=475713afff0a6e0518e0a2a514aab3b2804b95b8;p=dbsrgits%2FDBIx-Class.git

fix a couple test failures on Win32

Adds a skip_all to t/storage/global_destruction.t due to it causing a
segfault triggered by some sort of perl bug.

Adds a \Q...\E to t/94versioning.t in a warning regex as well as
changing a `perl -pi -e` to `perl -pi.bak -e` and removing an extraneous
semicolon for the test to pass.
---

diff --git a/t/94versioning.t b/t/94versioning.t
index a2e4007..e6eb0e2 100644
--- a/t/94versioning.t
+++ b/t/94versioning.t
@@ -85,8 +85,8 @@ my $schema_v2 = DBICVersion::Schema->connect($dsn, $user, $pass, { ignore_versio
   warnings_exist (
     sub { $schema_v2->create_ddl_dir('MySQL', '2.0', $ddl_dir, '1.0') },
     [
-      qr/Overwriting existing DDL file - $fn->{v2}/,
-      qr/Overwriting existing diff file - $fn->{trans_v12}/,
+      qr/Overwriting existing DDL file - \Q$fn->{v2}\E/,
+      qr/Overwriting existing diff file - \Q$fn->{trans_v12}\E/,
     ],
     'An overwrite warning generated for both the DDL and the diff',
   );
@@ -176,7 +176,7 @@ my $schema_v3 = DBICVersion::Schema->connect($dsn, $user, $pass, { ignore_versio
 }
 
 # add a "harmless" comment before one of the statements.
-system( qq($^X -pi -e "s/ALTER/-- this is a comment\nALTER/" $fn->{trans_v23};) );
+system( qq($^X -pi.bak -e "s/ALTER/-- this is a comment\nALTER/" $fn->{trans_v23}) );
 
 # Then attempt v1 -> v3 upgrade
 {
diff --git a/t/storage/global_destruction.t b/t/storage/global_destruction.t
index 629f7b7..e92a3a6 100644
--- a/t/storage/global_destruction.t
+++ b/t/storage/global_destruction.t
@@ -9,6 +9,8 @@ use DBIx::Class::Optional::Dependencies ();
 use lib qw(t/lib);
 use DBICTest;
 
+plan skip_all => 'Test segfaults on Win32' if $^O eq 'MSWin32';
+
 for my $type (qw/PG MYSQL/) {
 
   SKIP: {