Skip to content

Instantly share code, notes, and snippets.

@nihen
Created December 21, 2012 05:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nihen/4350941 to your computer and use it in GitHub Desktop.
Save nihen/4350941 to your computer and use it in GitHub Desktop.
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