all tests and deployment stuff working probably again after subtle regex tweaks
John Napiorkowski [Fri, 12 Jun 2009 17:20:17 +0000 (17:20 +0000)]
lib/DBIx/Class/Storage/DBI.pm
t/105-run-file-against-storage.t

index 64df75a..51afbf0 100644 (file)
@@ -2097,7 +2097,6 @@ sub _normalize_lines {
 Given a string, returns all the individual SQL statements in that String
 as an Array.
 
-
 =cut
 
 sub _split_line_into_statements {
@@ -2108,13 +2107,12 @@ sub _split_line_into_statements {
     |
     '[^']+'
     |
-    .+?(?=$deliminator)
+    .+?(?=$deliminator|.)
   /x;
 
   return ($line=~m/$maybe_quoted*?$deliminator/g);
 }
 
-
 =head2 _normalize_statements_from_lines 
 
   my @statements = $storage->_normalize_statements_from_lines(@lines)
index 1e2b688..fe3ddac 100644 (file)
@@ -35,7 +35,7 @@ is_deeply [$storage->_split_line_into_statements("aaa;bbb;ccc;")],["aaa;", "bbb;
  "Correctly split";
 
 is_deeply [$storage->_split_line_into_statements("insert into artist(artistid,name) values(888888,'xxx;yyy;zzz');")],
-  ["insert into artist(artistid,name) values(888888,'xxx;yyy;zzz');"],
+  ["insert into artist(artistid,name) values(888888,'xxx;yyy;zzz');",""],
   "Correctly split";
 
 ok my @lines = $storage->_normalize_lines(<$fh>), 'Got some lines';
@@ -142,5 +142,3 @@ lives_ok {
 ok $storage->run_file_against_storage(qw/t share simple.sql/), 'executed the simple';
 ok $storage->run_file_against_storage(qw/t share killer.sql/), 'executed the killer';
 
-use Data::Dump qw/dump/;
-warn dump $storage->_split_line_into_statements("insert into artist(artistid,name) values(888888,'xxx;yyy;zzz');");