Mercurial > hg > monetdb-perl
comparison DBD/t/02cxn.t @ 0:cedccb7e0143
Copy of clients/perl directory without Tests from MonetDB changeset 4d2d4532228a.
author | Sjoerd Mullender <sjoerd@acm.org> |
---|---|
date | Mon, 19 Sep 2016 15:15:52 +0200 (2016-09-19) |
parents | |
children | a0ec9e080a5b |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:cedccb7e0143 |
---|---|
1 #!perl -I./t | |
2 | |
3 # This Source Code Form is subject to the terms of the Mozilla Public | |
4 # License, v. 2.0. If a copy of the MPL was not distributed with this | |
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
6 # | |
7 # Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V. | |
8 | |
9 $| = 1; | |
10 | |
11 use strict; | |
12 use warnings; | |
13 use DBI(); | |
14 | |
15 use Test::More; | |
16 | |
17 if (defined $ENV{DBI_DSN}) { | |
18 plan tests => 8; | |
19 } else { | |
20 plan skip_all => 'Cannot test without DB info'; | |
21 } | |
22 | |
23 pass('Connection tests'); | |
24 | |
25 my $dbh = DBI->connect or die "Connect failed: $DBI::errstr\n"; | |
26 pass('Database connection created'); | |
27 | |
28 SKIP: { | |
29 skip('DBD::monetdb specific test', 1 ) if $dbh->{Driver}{Name} ne 'monetdb'; | |
30 | |
31 my $Cxn = $dbh->{monetdb_connection}; | |
32 | |
33 ok( $Cxn,"Connection object: $Cxn"); | |
34 } | |
35 ok( $dbh->ping,'Ping'); | |
36 | |
37 ok( $dbh->{Active},'Active'); | |
38 | |
39 ok( $dbh->disconnect,'Disconnect'); | |
40 | |
41 ok(!$dbh->ping,'Ping'); | |
42 | |
43 ok(!$dbh->{Active},'Active'); |