Propagate quote_names setting to SQLite SQLT producer
[dbsrgits/DBIx-Class.git] / t / storage / quote_names.t
index cbf572a..6492f25 100644 (file)
@@ -88,6 +88,9 @@ my %dbs = (
   MSSQL_ODBC       => 'DBIx::Class::Storage::DBI::MSSQL',
 );
 
+# lie that we already locked stuff - the tests below do not touch anything
+$ENV{DBICTEST_LOCK_HOLDER} = -1;
+
 # Make sure oracle is tried last - some clients (e.g. 10.2) have symbol
 # clashes with libssl, and will segfault everything coming after them
 for my $db (sort {
@@ -123,6 +126,14 @@ for my $db (sort {
   is $schema->storage->sql_maker->name_sep,
     $exp_name_sep,
     "$db name_sep with quote_names => 1 is $name_sep_text";
+
+  # if something was produced - it better be quoted
+  if ( my $ddl = try { $schema->deployment_statements } ) {
+
+    my $quoted_artist = $schema->storage->sql_maker->_quote('artist');
+
+    like ($ddl, qr/^CREATE\s+TABLE\s+\Q$quoted_artist/msi, "$db DDL contains expected quoted table name");
+  }
 }
 
 done_testing;