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).

The number of tests to plan should be adapted accordingly. It can be computed like this :

plan tests => $n_normal_tests * @CALL_FUNCS + 1;

The additional + 1 is required when using Test::NoWarnings, because that module adds a final test in an END block outside of the loop.

$sqleet_sqlite_call

$dbh->$sqleet_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 $sqleet_sqlite_call, the most appropriate API is chosen automatically and called only once.

has_sqleet_sqlite

has_sqleet_sqlite('3.24.0');

returns true if DBD::SQLeet is built with a version of SQLite equal to or higher than the specified version.

requires_sqleet_sqlite

BEGIN { requires_sqleet_sqlite('3.6.11'); }

skips all the tests if DBD::SQLeet is not built with a version of SQLite equal to or higher than the specified version.