[Bast-commits] r5711 - SQL-Abstract/1.x/branches/1.50_RC/t
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Sun Mar 8 22:43:57 GMT 2009
Author: ribasushi
Date: 2009-03-08 22:43:57 +0000 (Sun, 08 Mar 2009)
New Revision: 5711
Modified:
SQL-Abstract/1.x/branches/1.50_RC/t/03values.t
Log:
Clarify insanedness of test
Modified: SQL-Abstract/1.x/branches/1.50_RC/t/03values.t
===================================================================
--- SQL-Abstract/1.x/branches/1.50_RC/t/03values.t 2009-03-08 22:37:36 UTC (rev 5710)
+++ SQL-Abstract/1.x/branches/1.50_RC/t/03values.t 2009-03-08 22:43:57 UTC (rev 5711)
@@ -85,17 +85,23 @@
}
# test values() with literal sql
+#
+# NOTE:
+# The example is deliberately complicated by the addition of a literal ? in xfunc
+# This is an intentional test making sure literal ? remains untouched.
+# It is rather impractical in the field, as the user will have to insert
+# a bindvalue for the literal position(s) in the correct offset of \@bind
{
my $sql = SQL::Abstract->new;
- my $data = { event => 'rapture', time => \ 'now()', func => \ 'somefunc(?)', stuff => 'fluff', };
+ my $data = { event => 'rapture', time => \ 'now()', xfunc => \ 'somefunc(?)', stuff => 'fluff', };
my ($stmt, @bind) = $sql->insert ('table', $data);
is_same_sql_bind (
$stmt,
\@bind,
- 'INSERT INTO table ( event, func, stuff, time) VALUES ( ?, somefunc (?), ?, now() )',
+ 'INSERT INTO table ( event, stuff, time, xfunc) VALUES ( ?, ?, now(), somefunc (?) )',
[qw/rapture fluff/], # event < stuff
);
@@ -103,5 +109,5 @@
[$sql->values ($data)],
[\@bind],
'values() output matches that of initial bind'
- );
+ ) || diag "Corresponding SQL statement: $stmt";
}
More information about the Bast-commits
mailing list