From: John Napiorkowski Date: Fri, 12 Jun 2009 17:20:17 +0000 (+0000) Subject: all tests and deployment stuff working probably again after subtle regex tweaks X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=aa086ceaf1be95e915898182ea7a0b1664eef30c;p=dbsrgits%2FDBIx-Class-Historic.git all tests and deployment stuff working probably again after subtle regex tweaks --- diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 64df75a..51afbf0 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -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) diff --git a/t/105-run-file-against-storage.t b/t/105-run-file-against-storage.t index 1e2b688..fe3ddac 100644 --- a/t/105-run-file-against-storage.t +++ b/t/105-run-file-against-storage.t @@ -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');");