X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F05in_between.t;h=2ae0172ae3cf61aac6e9e24ddf9c7f2fc29016eb;hb=428975b0e646c0769d7eb530d4f52443471a9a9a;hp=3ca3c676495737e69ba91f14adabef111f16b0a3;hpb=032dfe204e1d3d8dc43116c8b25ebbca257e9ac0;p=dbsrgits%2FSQL-Abstract.git diff --git a/t/05in_between.t b/t/05in_between.t index 3ca3c67..2ae0172 100644 --- a/t/05in_between.t +++ b/t/05in_between.t @@ -64,6 +64,26 @@ my @in_between_tests = ( bind => [], test => '-between with literal sql with a literal (\"\'this\' AND \'that\'")', }, + + # generate a set of invalid -between tests + ( map { { + where => { x => { -between => $_ } }, + test => 'invalid -between args', + exception => qr|Operator 'BETWEEN' requires either an arrayref with two defined values or expressions, or a single literal scalarref/arrayref-ref|, + } } ( + [ 1, 2, 3 ], + [ 1, undef, 3 ], + [ undef, 2, 3 ], + [ 1, 2, undef ], + [ 1, undef ], + [ undef, 2 ], + [ undef, undef ], + [ 1 ], + [ undef ], + [], + 1, + undef, + )), { where => { start0 => { -between => [ 1, { -upper => 2 } ] }, @@ -183,7 +203,7 @@ my @in_between_tests = ( where => { x => { -in => [ 1, undef ] } }, stmt => " WHERE ( x IN ( ? ) OR x IS NULL )", bind => [ 1 ], - test => '-in with undef as an element', + test => '-in with undef as an element', }, { exception => qr/