AnyEvent-DBI-Abstract-Limit

 view release on metacpan or  search on metacpan

inc/Test/Base.pm  view on Meta::CPAN

    ) {
        Test::More::is($actual, $expected, $name);
    }
    else {
        $name = '' unless defined $name;
        ok $actual eq $expected,
           $name . "\n" . Text::Diff::diff(\$expected, \$actual);
    }
}

sub run(&;$) {
    (my ($self), @_) = find_my_self(@_);
    my $callback = shift;
    for my $block (@{$self->block_list}) {
        $block->run_filters unless $block->is_filtered;
        &{$callback}($block);
    }
}

my $name_error = "Can't determine section names";
sub _section_names {

t/test.t  view on Meta::CPAN

use Test::More;
use Test::Requires qw(DBD::SQLite);
use AnyEvent::DBI::Abstract::Limit;

sub sync(&;&) {
    my $block = shift;
    my $cb = shift;
    my $cv = AnyEvent->condvar;
    $cv->cb(sub { $cb->($_[0]->recv) }) if $cb;
    $block->($cv);
    $cv->recv;
}

my $dbh = AnyEvent::DBI::Abstract::Limit->new("dbi:SQLite:dbname=t/test.db", "", "");
sync { $dbh->exec("create table foo (id integer, foo text)", @_) };



( run in 0.823 second using v1.01-cache-2.11-cpan-49f99fa48dc )