Deprecate emulate_limit() - can not be sanely supported by DQ
[dbsrgits/DBIx-Class.git] / t / sqlmaker / limit_dialects / custom.t
index 650cd99..1bf3e07 100644 (file)
@@ -2,6 +2,7 @@ use strict;
 use warnings;
 
 use Test::More;
+use Test::Warn;
 
 use lib qw(t/lib);
 use DBICTest;
@@ -27,7 +28,8 @@ my $s = DBICTest::Schema->connect (DBICTest->_database);
 $s->storage->sql_maker_class ('DBICTest::SQLMaker::CustomDialect');
 
 my $rs = $s->resultset ('CD');
-is_same_sql_bind (
+
+warnings_exist { is_same_sql_bind (
   $rs->search ({}, { rows => 1, offset => 3,columns => [
       { id => 'foo.id' },
       { 'bar.id' => 'bar.id' },
@@ -45,6 +47,9 @@ is_same_sql_bind (
   )',
   [],
   'Rownum subsel aliasing works correctly'
-);
+ )}
+  qr/\Qthe legacy emulate_limit() mechanism inherited from SQL::Abstract::Limit has been deprecated/,
+  'deprecation warning'
+;
 
 done_testing;