X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fstorage%2Fquote_names.t;h=ac65fa07b17d073df2bb606617fafe2a795cdf02;hb=84efb6d7f74f92330bf03e923a5386bbf5e7cf7e;hp=cbf572a00cc7d89ab045adbabec9508219dad7a7;hpb=a0034ff6946ef2782a34d5c1f333eb448833e46f;p=dbsrgits%2FDBIx-Class.git diff --git a/t/storage/quote_names.t b/t/storage/quote_names.t index cbf572a..ac65fa0 100644 --- a/t/storage/quote_names.t +++ b/t/storage/quote_names.t @@ -88,6 +88,11 @@ my %dbs = ( MSSQL_ODBC => 'DBIx::Class::Storage::DBI::MSSQL', ); +# lie that we already locked stuff - the tests below do not touch anything +# unless we are under travis, where the OOM killers reign and things are rough +$ENV{DBICTEST_LOCK_HOLDER} = -1 + unless DBICTest::RunMode->is_ci; + # 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 { @@ -101,12 +106,12 @@ for my $db (sort { my $schema; - try { + my $sql_maker = try { $schema = DBICTest::Schema->connect($dsn, $user, $pass, { quote_names => 1 }); $schema->storage->ensure_connected; - 1; + $schema->storage->sql_maker; } || next; my ($exp_quote_char, $exp_name_sep) = @@ -115,14 +120,26 @@ for my $db (sort { my ($quote_char_text, $name_sep_text) = map { dumper($_) } ($exp_quote_char, $exp_name_sep); - is_deeply $schema->storage->sql_maker->quote_char, + is_deeply $sql_maker->quote_char, $exp_quote_char, "$db quote_char with quote_names => 1 is $quote_char_text"; - is $schema->storage->sql_maker->name_sep, + is $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 ( + # the SQLT producer has no idea what quotes are :/ + ! grep { $db eq $_ } qw( SYBASE DB2 ) + and + my $ddl = try { $schema->deployment_statements } + ) { + my $quoted_artist = $sql_maker->_quote('artist'); + + like ($ddl, qr/^CREATE\s+TABLE\s+\Q$quoted_artist/msi, "$db DDL contains expected quoted table name"); + } } done_testing;