[Bast-commits] r5717 - SQL-Abstract/1.x/branches/1.50_RC/t
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Mon Mar 9 01:32:09 GMT 2009
Author: ribasushi
Date: 2009-03-09 01:32:08 +0000 (Mon, 09 Mar 2009)
New Revision: 5717
Modified:
SQL-Abstract/1.x/branches/1.50_RC/t/02where.t
SQL-Abstract/1.x/branches/1.50_RC/t/03values.t
Log:
Enhance values test
Modified: SQL-Abstract/1.x/branches/1.50_RC/t/02where.t
===================================================================
--- SQL-Abstract/1.x/branches/1.50_RC/t/02where.t 2009-03-09 01:26:52 UTC (rev 5716)
+++ SQL-Abstract/1.x/branches/1.50_RC/t/02where.t 2009-03-09 01:32:08 UTC (rev 5717)
@@ -13,8 +13,7 @@
my $not_stringifiable = bless {}, 'SQLA::NotStringifiable';
-my at x=(
-);my @handle_tests = (
+my @handle_tests = (
{
where => {
requestor => 'inna',
@@ -199,19 +198,17 @@
{
where => \[ 'foo = ?','bar' ],
- stmt => " WHERE (foo = ?)",
+ stmt => " WHERE (foo = ?)",
bind => [ "bar" ],
},
{
where => [ \[ 'foo = ?','bar' ] ],
- stmt => " WHERE (foo = ?)",
+ stmt => " WHERE (foo = ?)",
bind => [ "bar" ],
},
-);my at x2=(
);
-
plan tests => ( @handle_tests * 2 ) + 1;
for my $case (@handle_tests) {
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-09 01:26:52 UTC (rev 5716)
+++ SQL-Abstract/1.x/branches/1.50_RC/t/03values.t 2009-03-09 01:32:08 UTC (rev 5717)
@@ -94,20 +94,28 @@
{
my $sql = SQL::Abstract->new;
- my $data = { event => 'rapture', time => \ 'now()', xfunc => \ 'somefunc(?)', stuff => 'fluff', };
+ my $data = {
+ event => 'rapture',
+ stuff => 'fluff',
+ time => \ 'now()',
+ xfunc => \ 'xfunc(?)',
+ yfunc => ['yfunc(?)', 'ystuff' ],
+ zfunc => \['zfunc(?)', 'zstuff' ],
+ zzlast => 'zzstuff',
+ };
my ($stmt, @bind) = $sql->insert ('table', $data);
is_same_sql_bind (
$stmt,
\@bind,
- 'INSERT INTO table ( event, stuff, time, xfunc) VALUES ( ?, ?, now(), somefunc (?) )',
- [qw/rapture fluff/], # event < stuff
+ 'INSERT INTO table ( event, stuff, time, xfunc, yfunc, zfunc, zzlast) VALUES ( ?, ?, now(), xfunc (?), yfunc(?), zfunc(?), ? )',
+ [qw/rapture fluff ystuff zstuff zzstuff/], # event < stuff
);
is_same_bind (
[$sql->values ($data)],
[@bind],
'values() output matches that of initial bind'
- );# || diag "Corresponding SQL statement: $stmt";
+ ) || diag "Corresponding SQL statement: $stmt";
}
More information about the Bast-commits
mailing list