From: Dagfinn Ilmari Mannsåker Date: Wed, 3 Feb 2010 17:16:59 +0000 (+0000) Subject: Fix expected file count and table dropping when skip_rels=1 X-Git-Tag: 0.05001~11 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class-Schema-Loader.git;a=commitdiff_plain;h=1369eb944e95fd5d2454236aa63f965a8d5a0465 Fix expected file count and table dropping when skip_rels=1 --- diff --git a/t/lib/dbixcsl_common_tests.pm b/t/lib/dbixcsl_common_tests.pm index 7b970ff..3d0e335 100644 --- a/t/lib/dbixcsl_common_tests.pm +++ b/t/lib/dbixcsl_common_tests.pm @@ -127,10 +127,13 @@ sub setup_schema { @{ $self->{extra}{create} || [] }; $expected_count -= grep /CREATE TABLE/, @statements_inline_rels - if $self->{no_inline_rels}; + if $self->{skip_rels} || $self->{no_inline_rels}; $expected_count -= grep /CREATE TABLE/, @statements_implicit_rels - if $self->{no_implicit_rels}; + if $self->{skip_rels} || $self->{no_implicit_rels}; + + $expected_count -= grep /CREATE TABLE/, ($self->{vendor} =~ /sqlite/ ? @statements_advanced_sqlite : @statements_advanced), @statements_reltests + if $self->{skip_rels}; is $file_count, $expected_count, 'correct number of files generated'; @@ -1282,9 +1285,8 @@ sub drop_tables { unless($self->{no_implicit_rels}) { $dbh->do("DROP TABLE $_") for (@tables_implicit_rels); } - $dbh->do("DROP TABLE $_") for (@tables_rescan); } - $dbh->do("DROP TABLE $_") for (@tables); + $dbh->do("DROP TABLE $_") for (@tables, @tables_rescan); $dbh->do($_) for map { $drop_auto_inc->(@$_) } @tables_auto_inc; $dbh->disconnect; }