add link to dbicdump in ::Loader docs
[dbsrgits/DBIx-Class-Schema-Loader.git] / t / 18firebird_common.t
index 49bf67f..cd1014e 100644 (file)
@@ -41,7 +41,9 @@ my $tester = dbixcsl_common_tests->new(
         );
     },
     null        => '',
-    loader_options => { unquoted_ddl => 1 },
+    preserve_case_mode_is_exclusive => 1,
+    quote_char                      => '"',
+    warnings => [ qr/'preserve_case' option/ ],
     connect_info => [ ($dbd_interbase_dsn ? {
             dsn         => $dbd_interbase_dsn,
             user        => $dbd_interbase_user,
@@ -63,13 +65,13 @@ my $tester = dbixcsl_common_tests->new(
         'int'         => { data_type => 'integer' },
         'integer'     => { data_type => 'integer' },
         'bigint'      => { data_type => 'bigint' },
-        'float'       => { data_type => 'float' },
+        'float'       => { data_type => 'real' },
         'double precision' =>
                          { data_type => 'double precision' },
-        'real'        => { data_type => 'float' },
+        'real'        => { data_type => 'real' },
 
-        'float(2)'    => { data_type => 'float' },
-        'float(7)'    => { data_type => 'float' },
+        'float(2)'    => { data_type => 'real' },
+        'float(7)'    => { data_type => 'real' },
         'float(8)'    => { data_type => 'double precision' },
 
         'decimal'     => { data_type => 'decimal' },
@@ -82,14 +84,20 @@ my $tester = dbixcsl_common_tests->new(
         'dec(3,3)'     => { data_type => 'decimal', size => [3,3] },
         'numeric(3,3)' => { data_type => 'numeric', size => [3,3] },
 
+        'decimal(6,3)' => { data_type => 'decimal', size => [6,3] },
+        'numeric(6,3)' => { data_type => 'numeric', size => [6,3] },
+
+        'decimal(12,3)' => { data_type => 'decimal', size => [12,3] },
+        'numeric(12,3)' => { data_type => 'numeric', size => [12,3] },
+
         'decimal(18,18)' => { data_type => 'decimal', size => [18,18] },
         'dec(18,18)'     => { data_type => 'decimal', size => [18,18] },
         'numeric(18,18)' => { data_type => 'numeric', size => [18,18] },
 
         # Date and Time Types
         'date'        => { data_type => 'date' },
-        'timestamp DEFAULT CURRENT_TIMESTAMP'
-                      => { data_type => 'timestamp', default_value => \"CURRENT_TIMESTAMP" },
+        'timestamp default current_timestamp'
+                      => { data_type => 'timestamp', default_value => \'current_timestamp' },
         'time'        => { data_type => 'time' },
 
         # String Types
@@ -103,9 +111,10 @@ my $tester = dbixcsl_common_tests->new(
                       => { data_type => 'blob sub_type text' },
     },
     extra => {
-        count  => 7,
+        count  => 6,
         run    => sub {
             $schema = shift;
+            my ($monikers, $classes, $self) = @_;
 
             cleanup_extra();
 
@@ -135,20 +144,10 @@ q{
 
             my $guard = Scope::Guard->new(\&cleanup_extra);
 
-            delete $schema->_loader->{unquoted_ddl};
+            local $schema->_loader->{preserve_case} = 1;
+            $schema->_loader->_setup;
 
-            my $warning;
-            {
-                local $SIG{__WARN__} = sub { $warning = shift };
-                $schema->_loader->_setup;
-            }
-            like $warning, qr/unquoted_ddl option/,
-                'warning mentions unquoted_ddl option';
-
-            {
-                local $SIG{__WARN__} = sub {};
-                $schema->rescan;
-            }
+            $self->rescan_without_warnings($schema);
 
             ok ((my $rsrc = eval { $schema->resultset('FirebirdLoaderTest1')->result_source }),
                 'got rsrc for mixed case table');
@@ -173,7 +172,8 @@ if (not ($dbd_interbase_dsn || $odbc_dsn)) {
 else {
     # get rid of stupid warning from InterBase/GetInfo.pm
     if ($dbd_interbase_dsn) {
-        local $SIG{__WARN__} = sub {};
+        local $SIG{__WARN__} = sub { warn @_
+            unless $_[0] =~ m|^Use of uninitialized value in sprintf at \S+DBD/InterBase/GetInfo\.pm line \d+\.$| };
         require DBD::InterBase;
         require DBD::InterBase::GetInfo;
     }
@@ -192,3 +192,4 @@ sub cleanup_extra {
         eval { $dbh->do($stmt) };
     }
 }
+# vim:et sts=4 sw=4 tw=0: