Mercurial > hg > monetdb-perl
comparison DBD/t/06ti.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 => 5; | |
19 } else { | |
20 plan skip_all => 'Cannot test without DB info'; | |
21 } | |
22 | |
23 my $dbh = DBI->connect or die "Connect failed: $DBI::errstr\n"; | |
24 ok ( defined $dbh,'Connection'); | |
25 | |
26 my @ti = $dbh->type_info; | |
27 ok( @ti,'type_info'); | |
28 for my $ti ( @ti ) { | |
29 print "#\n"; | |
30 printf "# %-20s => %s\n", $_, DBI::neat( $ti->{$_} ) for sort keys %$ti; | |
31 } | |
32 | |
33 my $tia = $dbh->type_info_all; | |
34 is( ref $tia,'ARRAY','type_info_all'); | |
35 | |
36 my $idx = shift @$tia; | |
37 is( ref $idx,'HASH','index hash'); | |
38 | |
39 print '# ', DBI::neat_list( $_ ), "\n" for @$tia; | |
40 | |
41 ok( $dbh->disconnect,'Disconnect'); |