From 7c48e67cf07ee41bfde7139a62bb232bd23a4a48 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Wed, 6 Jun 2012 16:41:29 +0000 Subject: Imported from /srv/lorry/lorry-area/perl-dbi-tarball/DBI-1.622.tar.gz. --- t/65transact.t | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 t/65transact.t (limited to 't/65transact.t') diff --git a/t/65transact.t b/t/65transact.t new file mode 100644 index 0000000..f3d672b --- /dev/null +++ b/t/65transact.t @@ -0,0 +1,35 @@ +#!perl -w +$|=1; + +use strict; + +use DBI; + +use Test::More; + +plan skip_all => 'Transactions not supported by DBD::Gofer' + if $ENV{DBI_AUTOPROXY} && $ENV{DBI_AUTOPROXY} =~ /^dbi:Gofer/i; + +plan tests => 10; + +my $dbh = DBI->connect('dbi:ExampleP(AutoCommit=>1):', undef, undef) + or die "Unable to connect to ExampleP driver: $DBI::errstr"; + +print "begin_work...\n"; +ok($dbh->{AutoCommit}); +ok(!$dbh->{BegunWork}); + +ok($dbh->begin_work); +ok(!$dbh->{AutoCommit}); +ok($dbh->{BegunWork}); + +$dbh->commit; +ok($dbh->{AutoCommit}); +ok(!$dbh->{BegunWork}); + +ok($dbh->begin_work({})); +$dbh->rollback; +ok($dbh->{AutoCommit}); +ok(!$dbh->{BegunWork}); + +1; -- cgit v1.2.1