… | |
… | |
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 | |
17 | use strict; |
17 | use strict; |
18 | use warnings; |
18 | use warnings; |
19 | use AnyEvent; |
19 | use AnyEvent; |
… | |
… | |
101 | ($error,$result,$rv) = $cv->recv(); |
101 | ($error,$result,$rv) = $cv->recv(); |
102 | ok(!$error,'No errors inserting into table'); |
102 | ok(!$error,'No errors inserting into table'); |
103 | ok($rv,'select succeeded'); |
103 | ok($rv,'select succeeded'); |
104 | is($result->[0]->[0],'test','found correct data'); |
104 | is($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; |
|
|
112 | is($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(); |
110 | ok(!$error,'No errors occur while checking attribute'); |
118 | ok(!$error,'No errors occur while checking attribute'); |