[svn:DBD-Pg] r14535 - DBD-Pg/trunk/t

[email protected]
Newsgroups gmane.comp.db.postgresql.dbdpg.cvs
Message-ID <[email protected]>
Author: turnstep
Date: Sat Nov 20 20:46:41 2010
New Revision: 14535

Modified:
   DBD-Pg/trunk/t/01connect.t

Log:
Make sure case doesn't matter in DBI: connection. This is a DBI job: simply here as a sanity check.


Modified: DBD-Pg/trunk/t/01connect.t
==============================================================================
--- DBD-Pg/trunk/t/01connect.t	(original)
+++ DBD-Pg/trunk/t/01connect.t	Sat Nov 20 20:46:41 2010
@@ -24,7 +24,7 @@
 if (! defined $dbh or $connerror) {
 	plan skip_all => 'Connection to database failed, cannot continue testing';
 }
-plan tests => 13;
+plan tests => 15;
 
 pass ('Established a connection to the database');
 
@@ -86,6 +86,22 @@
 		is ($err, '', $t);
 	}
 
+	$t=q{Connect with forced uppercase 'DBI:' works};
+	my ($testdsn,$testuser,$helpconnect,$su,$uid,$testdir,$pg_ctl,$initdb,$error,$version)
+		= get_test_settings();
+	$testdsn =~ s/^dbi/DBI/i;
+	my $ldbh = DBI->connect($testdsn, $testuser, $ENV{DBI_PASS},
+        {RaiseError => 1, PrintError => 0, AutoCommit => 0});
+	ok (ref $ldbh, $t);
+	$ldbh->disconnect();
+
+	$t=q{Connect with mixed case 'DbI:' works};
+	$testdsn =~ s/^dbi/DbI/i;
+	$ldbh = DBI->connect($testdsn, $testuser, $ENV{DBI_PASS},
+        {RaiseError => 1, PrintError => 0, AutoCommit => 0});
+	ok (ref $ldbh, $t);
+	$ldbh->disconnect();
+
 	if ($ENV{DBI_DSN} =~ /$alias\s*=\s*\"/) {
 		skip ('DBI_DSN already contains quoted database, no need for explicit test', 1);
 	}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.