[Bast-commits] r5790 - SQL-Abstract/1.x/trunk/t
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Sat Mar 21 17:26:05 GMT 2009
Author: ribasushi
Date: 2009-03-21 17:26:05 +0000 (Sat, 21 Mar 2009)
New Revision: 5790
Modified:
SQL-Abstract/1.x/trunk/t/10test.t
Log:
test SQLA::Test shortcommings
Modified: SQL-Abstract/1.x/trunk/t/10test.t
===================================================================
--- SQL-Abstract/1.x/trunk/t/10test.t 2009-03-21 16:20:11 UTC (rev 5789)
+++ SQL-Abstract/1.x/trunk/t/10test.t 2009-03-21 17:26:05 UTC (rev 5790)
@@ -97,6 +97,24 @@
/,
]
},
+ {
+ equal => 1,
+ todo => '( (x AND y) AND z ) should be reducable to ( x AND y AND z )',
+ statements => [
+ q/SELECT foo FROM bar WHERE a = 1 AND b = 1 AND c = 1/,
+ q/SELECT foo FROM bar WHERE (a = 1 AND b = 1) AND c = 1/,
+ q/SELECT foo FROM bar WHERE a = 1 AND (b = 1 AND c = 1)/,
+ ]
+ },
+ {
+ equal => 1,
+ todo => '( (x OR y) OR z ) should be reducable to ( x OR y OR z )',
+ statements => [
+ q/SELECT foo FROM bar WHERE a = 1 OR b = 1 OR c = 1/,
+ q/SELECT foo FROM bar WHERE (a = 1 OR b = 1) OR c = 1/,
+ q/SELECT foo FROM bar WHERE a = 1 OR (b = 1 OR c = 1)/,
+ ]
+ },
# WHERE condition - different
{
@@ -158,6 +176,22 @@
q/SELECT foo FROM bar JOIN quux ON a = 1 WHERE a = 1 AND b = 1/,
]
},
+ {
+ equal => 0,
+ statements => [
+ q/SELECT foo FROM bar WHERE a = 1 AND b = 1 OR c = 1/,
+ q/SELECT foo FROM bar WHERE (a = 1 AND b = 1) OR c = 1/,
+ q/SELECT foo FROM bar WHERE a = 1 AND (b = 1 OR c = 1)/,
+ ]
+ },
+ {
+ equal => 0,
+ statements => [
+ q/SELECT foo FROM bar WHERE a = 1 OR b = 1 AND c = 1/,
+ q/SELECT foo FROM bar WHERE (a = 1 OR b = 1) AND c = 1/,
+ q/SELECT foo FROM bar WHERE a = 1 OR (b = 1 AND c = 1)/,
+ ]
+ },
# JOIN condition - equal
{
@@ -667,15 +701,19 @@
my $sql1 = shift @$statements;
foreach my $sql2 (@$statements) {
my $equal = eq_sql($sql1, $sql2);
- if ($test->{equal}) {
- ok($equal, "equal SQL expressions considered equal");
- } else {
- ok(!$equal, "different SQL expressions considered not equal");
- }
+ TODO: {
+ local $TODO = $test->{todo} if $test->{todo};
- if ($equal ^ $test->{equal}) {
- diag("sql1: $sql1");
- diag("sql2: $sql2");
+ if ($test->{equal}) {
+ ok($equal, "equal SQL expressions should have been considered equal");
+ } else {
+ ok(!$equal, "different SQL expressions should have been considered not equal");
+ }
+
+ if ($equal ^ $test->{equal}) {
+ diag("sql1: $sql1");
+ diag("sql2: $sql2");
+ }
}
}
}
More information about the Bast-commits
mailing list