X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F99dbic_sqlt_parser.t;h=4d1ddac4b5924e875ad0fb3b1c352e5461c6a797;hb=d2bc7045e78e5bc547e32133e48d2f994d158491;hp=86ddf764eb4e08189a24efc8602dfa65282d2d3c;hpb=206d1995f35d94234c8333b4be4d403017282a43;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/99dbic_sqlt_parser.t b/t/99dbic_sqlt_parser.t index 86ddf76..4d1ddac 100644 --- a/t/99dbic_sqlt_parser.t +++ b/t/99dbic_sqlt_parser.t @@ -5,6 +5,8 @@ use Test::More; use Test::Exception; use lib qw(t/lib); use DBICTest; +use DBICTest::Schema; +use Scalar::Util (); BEGIN { require DBIx::Class::Storage::DBI; @@ -13,6 +15,16 @@ BEGIN { if not DBIx::Class::Storage::DBI->_sqlt_version_ok; } +# Test for SQLT-related leaks +{ + my $s = DBICTest::Schema->clone; + create_schema ({ schema => $s }); + Scalar::Util::weaken ($s); + + ok (!$s, 'Schema not leaked'); +} + + my $schema = DBICTest->init_schema(); # Dummy was yanked out by the sqlt hook test # CustomSql tests the horrific/deprecated ->name(\$sql) hack @@ -84,6 +96,24 @@ my @sources = grep 'parser detects views with a view_definition'; } +lives_ok (sub { + my $sqlt_schema = create_schema ({ + schema => $schema, + args => { + parser_args => { + sources => ['CD'] + }, + }, + }); + + is_deeply ( + [$sqlt_schema->get_tables ], + ['cd'], + 'sources limitng with relationships works', + ); + +}); + done_testing; sub create_schema {