dies
dies(sub {...}, $regex_expected_error, $msg)
Tests that the given coderef (most probably a closure) dies with the expected error message.
@CALL_FUNCS
The exported array @CALL_FUNCS contains a list of coderefs for testing several ways of calling driver-private methods. On DBI versions prior to 1.608, such methods were called through "func". Starting from 1.608, methods should be installed within the driver (see DBI::DBD) and are called through $dbh->sqlite_method_name(...). This array helps to test both ways. Usage :
for my $call_func (@CALL_FUNCS) {
my $dbh = connect_ok();
...
$dbh->$call_func(@args, 'method_to_call');
...
}
On DBI versions prior to 1.608, the loop will run only once and the method call will be equivalent to $dbh->func(@args, 'method_to_call'). On more recent versions, the loop will run twice; the second execution will call $dbh->sqlite_method_to_call(@args).
$sqlite_call
$dbh->$sqlite_call(meth_name => @args);
This is another way of testing driver-private methods, in a portable manner that works for DBI versions before or after 1.608. Unlike @CALL_FUNCS, this does not require to loop -- because after all, it doesn't make much sense to test the old ->func() interface if we have support for the new ->sqlite_*() interface. With $sqlite_call, the most appropriate API is chosen automatically and called only once.
has_compile_option
has_compile_option('ENABLE_FTS3');
has_compile_option(qr/^ENABLE_FTS[345]/);
returns true if DBD::SQLite is built with a specified compile option.
has_fts
has_fts();
has_fts(3);
returns true if DBD::SQLite is built with FTS.
has_sqlite
has_sqlite('3.6.11');
returns true if DBD::SQLite is built with a version of SQLite equal to or higher than the specified version.
requires_sqlite
BEGIN { requires_sqlite('3.6.11'); }
skips all the tests if DBD::SQLite is not built with a version of SQLite equal to or higher than the specified version.
requires_unicode_support
BEGIN { requires_unicode_support(); }
skips all the tests if Perl does not have sane Unicode support.
allow_warnings
allow_warnings { eval {...} };
hides SQLite warnings from Test::FailWarnings.