Test for the real leak reason
[dbsrgits/DBIx-Class-Historic.git] / t / 99dbic_sqlt_parser.t
index f8b88c3..7f05034 100644 (file)
@@ -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;
+  my $sqlt_s = 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