X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=install%2F5.005%2FDBD-Pg-1.22-fixvercmp%2Ft%2F11quoting.t;fp=install%2F5.005%2FDBD-Pg-1.22-fixvercmp%2Ft%2F11quoting.t;h=0000000000000000000000000000000000000000;hp=afec9632a2138249b341cb608e1d6055a38f14a3;hb=3a9c534d55e1736545ef8037e1391101c7a11f2b;hpb=7a67b0df697c1aa35e148bd5b2f1f765bf1969f6 diff --git a/install/5.005/DBD-Pg-1.22-fixvercmp/t/11quoting.t b/install/5.005/DBD-Pg-1.22-fixvercmp/t/11quoting.t deleted file mode 100644 index afec9632a..000000000 --- a/install/5.005/DBD-Pg-1.22-fixvercmp/t/11quoting.t +++ /dev/null @@ -1,50 +0,0 @@ -use strict; -use DBI; -use Test::More; - -if (defined $ENV{DBI_DSN}) { - plan tests => 8; -} else { - plan skip_all => 'cannot test without DB info'; -} - -my $dbh = DBI->connect($ENV{DBI_DSN}, $ENV{DBI_USER}, $ENV{DBI_PASS}, - {RaiseError => 1, AutoCommit => 0} - ); -ok(defined $dbh, - 'connect with transaction' - ); - -my %tests = ( - one=>["'", "'\\" . sprintf("%03o", ord("'")) . "'"], - two=>["''", "'" . ("\\" . sprintf("%03o", ord("'")))x2 . "'"], - three=>["\\", "'\\" . sprintf("%03o", ord("\\")) . "'"], - four=>["\\'", sprintf("'\\%03o\\%03o'", ord("\\"), ord("'"))], - five=>["\\'?:", sprintf("'\\%03o\\%03o?:'", ord("\\"), ord("'"))], - ); - -foreach my $test (keys %tests) { - my ($unq, $quo, $ref); - - $unq = $tests{$test}->[0]; - $ref = $tests{$test}->[1]; - $quo = $dbh->quote($unq); - - ok($quo eq $ref, - "$test: $unq -> expected $quo got $ref" - ); -} - -# Make sure that SQL_BINARY doesn't work. -# eval { $dbh->quote('foo', { TYPE => DBI::SQL_BINARY })}; -eval { - local $dbh->{PrintError} = 0; - $dbh->quote('foo', DBI::SQL_BINARY); -}; -ok($@ && $@ =~ /Use of SQL_BINARY invalid in quote/, - 'SQL_BINARY' -); - -ok($dbh->disconnect(), - 'disconnect' - );