Created
December 21, 2012 05:56
-
-
Save nihen/4350941 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Test::More; | |
use SQL::Maker::Condition; | |
my $w1 = SQL::Maker::Condition->new(); | |
$w1->add(1 => 1); | |
my $w2 = SQL::Maker::Condition->new(); | |
$w2->add(1 => 0); | |
my $w3= ($w1 | $w2); | |
$w3->add(1 => 0); | |
is $w3->as_sql, '((1 = ?) OR (1 = ?)) AND (1 = ?)'; # but got ((1 = ?)) OR ((1 = ?)) AND (1 = ?) | |
is join(', ', $w3->bind), '1, 0, 0'; | |
done_testing; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment