Author: turnstep
Date: Mon Jul 13 12:12:42 2009
New Revision: 13050
Modified:
DBD-Pg/trunk/t/09arrays.t
Log:
Quoting tweaks to accomodate new array quote logic.
Needs a second pair of eyes, mine are crossed from all the backslashes.
Modified: DBD-Pg/trunk/t/09arrays.t
==============================================================================
--- DBD-Pg/trunk/t/09arrays.t (original)
+++ DBD-Pg/trunk/t/09arrays.t Mon Jul 13 12:12:42 2009
@@ -18,7 +18,7 @@
if (! defined $dbh) {
plan skip_all => 'Connection to database failed, cannot continue
testing';
}
-plan tests => 250;
+plan tests => 256;
isnt ($dbh, undef, 'Connect to database for array testing');
@@ -51,6 +51,10 @@
$SQL = q{SELECT testarray3 FROM dbd_pg_test WHERE pname= 'Array Testing'};
my $getarray_bool = $dbh->prepare($SQL);
+## Input
+## Expected
+## Name of test
+
my $array_tests =
q!['']
{""}
@@ -160,13 +164,17 @@
{{"O\"RLY?"},{"'Ya' - \"really\""},{123}} quote: {{"O\"RLY?"},{"'Ya' -
\"really\""},{"123"}}
Many quotes
-["Test\\\\nRun"]
-{"Test\\\\nRun"} quote: {"Test\\\\\\nRun"}
-Simple backslash
-
-[["Test\\\\nRun","Quite \"so\""],["back\\\\\\\\slashes are a
\"pa\\\\in\"",123] ]
-{{"Test\\\\nRun","Quite \"so\""},{"back\\\\\\\\\\\\slashes are a
\"pa\\\\in\"",123}} quote: {{"Test\\\\\\nRun","Quite
\"so\""},{"back\\\\\\\\\\\\slashes are a \"pa\\\\\\in\"","123"}}
-Escape party
+["Single\\\\Backslash"]
+{"Single\\\\\\\\Backslash"} quote: {"Single\\\\\\\\Backslash"}
+Single backslash testing
+
+["Double\\\\\\\\Backslash"]
+{"Double\\\\\\\\\\\\\\\\Backslash"} quote: {"Double\\\\\\\\\\\\\\\\Backslash"}
+Double backslash testing
+
+[["Test\\\nRun","Quite \"so\""],["back\\\\\\\\slashes are a \"pa\\\\in\"",123]
]
+{{"Test\\\\\\\\nRun","Quite \"so\""},{"back\\\\\\\\\\\\\\\\slashes are a
\"pa\\\\\\\\in\"",123}} quote: {{"Test\\\\\\\nRun","Quite
\"so\""},{"back\\\\\\\\\\\\\\\\slashes are a \"pa\\\\\\\\in\"","123"}}
+Escape party - backslash+newline, two + one
[undef]
{NULL}
@@ -279,9 +287,6 @@
$qexpected =~ s/{}/{''}/;
$qexpected =~ y/{}/[]/;
$qexpected =~ s/NULL/undef/g;
- $qexpected =~ s/\\\\n/\\n/g;
- $qexpected =~ s/\\\\"/\\"/g;
- $qexpected =~ s/\\\\i/\\i/g;
if ($msg =~ /closing brace/) {
$qexpected =~ s/]"/}"/;
}