Fix duplicate tests for { -in => [ undef ] }
[dbsrgits/SQL-Abstract.git] / t / 05in_between.t
index 84bd215..1c2a8b4 100644 (file)
@@ -152,10 +152,10 @@ my @in_between_tests = (
     parenthesis_significant => 1,
     where => {
       customer => { -in => \[
-        '( SELECT cust_id FROM cust WHERE balance > ? )',
+        'SELECT cust_id FROM cust WHERE balance > ?',
         2000,
       ]},
-      status => { -in => \'( SELECT status_codes FROM states )' },
+      status => { -in => \'SELECT status_codes FROM states' },
     },
     stmt => "
       WHERE ((
@@ -174,20 +174,18 @@ my @in_between_tests = (
   },
   {
     where => { x => { -in => [ 1, undef ] } },
-    stmt => " WHERE ( x IN ( ?, NULL ) )",
+    stmt => " WHERE ( x IN ( ? ) OR x IS NULL )",
     bind => [ 1 ],
     test => '-in with undef as an element', 
   },
   {
     where => { x => { -in => [ 1, undef, 2, 3, undef ] } },
-    stmt => " WHERE ( x IN ( ?, NULL, ?, ?, NULL ) )",
+    stmt => " WHERE ( x IN ( ?, ?, ? ) OR x IS NULL )",
     bind => [ 1, 2, 3 ],
     test => '-in with undef as an element',
   },
 );
 
-plan tests => @in_between_tests*3;
-
 for my $case (@in_between_tests) {
   TODO: {
     local $TODO = $case->{todo} if $case->{todo};
@@ -214,3 +212,5 @@ for my $case (@in_between_tests) {
     diag "Error: $e\n Search term:\n".Dumper($case->{where}) if $e;
   }
 }
+
+done_testing;