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/20meta.t | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 t/20meta.t (limited to 't/20meta.t') diff --git a/t/20meta.t b/t/20meta.t new file mode 100644 index 0000000..a8d609e --- /dev/null +++ b/t/20meta.t @@ -0,0 +1,32 @@ +#!perl -w + +use strict; +use Test::More tests => 8; + +$|=1; +$^W=1; + +BEGIN { use_ok( 'DBI', ':sql_types' ) } +BEGIN { use_ok( 'DBI::DBD::Metadata' ) } # just to check for syntax errors etc + +my $dbh = DBI->connect("dbi:ExampleP:.","","", { FetchHashKeyName => 'NAME_lc' }) + or die "Unable to connect to ExampleP driver: $DBI::errstr"; + +isa_ok($dbh, 'DBI::db'); +#$dbh->trace(3); + +#use Data::Dumper; +#print Dumper($dbh->type_info_all); +#print Dumper($dbh->type_info); +#print Dumper($dbh->type_info(DBI::SQL_INTEGER)); + +my @ti = $dbh->type_info; +ok(@ti>0); + +is($dbh->type_info(SQL_INTEGER)->{DATA_TYPE}, SQL_INTEGER); +is($dbh->type_info(SQL_INTEGER)->{TYPE_NAME}, 'INTEGER'); + +is($dbh->type_info(SQL_VARCHAR)->{DATA_TYPE}, SQL_VARCHAR); +is($dbh->type_info(SQL_VARCHAR)->{TYPE_NAME}, 'VARCHAR'); + +1; -- cgit v1.2.1