ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-DBI/t/02_sql_lite.t
(Generate patch)

Comparing AnyEvent-DBI/t/02_sql_lite.t (file contents):
Revision 1.4 by root, Tue Aug 15 04:09:37 2017 UTC vs.
Revision 1.5 by root, Tue Aug 15 07:28:55 2017 UTC

9 }; 9 };
10 if ($@) { 10 if ($@) {
11 print "1..0 # SKIP this test requires Test::More and DBD::SQLite\n"; exit; 11 print "1..0 # SKIP this test requires Test::More and DBD::SQLite\n"; exit;
12 } 12 }
13 require Test::More; 13 require Test::More;
14 import Test::More tests => 43; 14 import Test::More tests => 44;
15} 15}
16 16
17use strict; 17use strict;
18use warnings; 18use warnings;
19use AnyEvent; 19use AnyEvent;
101($error,$result,$rv) = $cv->recv(); 101($error,$result,$rv) = $cv->recv();
102ok(!$error,'No errors inserting into table'); 102ok(!$error,'No errors inserting into table');
103ok($rv,'select succeeded'); 103ok($rv,'select succeeded');
104is($result->[0]->[0],'test','found correct data'); 104is($result->[0]->[0],'test','found correct data');
105 105
106# stattr
107$cv = AE::cv;
108$dbh->stattr ("NAME", sub {
109 $cv->send ($_[1]);
110});
111$rv = $cv->recv;
112is($rv->[0], "a_column", "NAME attribute returned correctly");
113
106# check the autocommit behavior 114# check the autocommit behavior
107$cv = AnyEvent->condvar; 115$cv = AnyEvent->condvar;
108$dbh->attr('AutoCommit',sub {return $cv->send($@) unless $_[1]; $cv->send(undef,$_[1])}); 116$dbh->attr('AutoCommit',sub {return $cv->send($@) unless $_[1]; $cv->send(undef,$_[1])});
109($error,$result)= $cv->recv(); 117($error,$result)= $cv->recv();
110ok(!$error,'No errors occur while checking attribute'); 118ok(!$error,'No errors occur while checking attribute');

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines