-#!/usr/bin/perl
-
use strict;
use warnings;
use Test::More;
my $sqlmaker = SQL::Abstract->new(special_ops => [
# special op for MySql MATCH (field) AGAINST(word1, word2, ...)
- {regex => qr/^match$/i,
+ {regex => qr/^match$/i,
handler => sub {
my ($self, $field, $op, $arg) = @_;
$arg = [$arg] if not ref $arg;
},
# special op for Basis+ NATIVE
- {regex => qr/^native$/i,
+ {regex => qr/^native$/i,
handler => sub {
my ($self, $field, $op, $arg) = @_;
$arg =~ s/'/''/g;
my @tests = (
- #1
+ #1
{ where => {foo => {-match => 'foo'},
bar => {-match => [qw/foo bar/]}},
stmt => " WHERE ( MATCH (bar) AGAINST (?, ?) AND MATCH (foo) AGAINST (?) )",
);
-
-plan tests => scalar(@tests);
-
for (@tests) {
my($stmt, @bind) = $sqlmaker->where($_->{where}, $_->{order});
is_same_sql_bind($stmt, \@bind, $_->{stmt}, $_->{bind});
}
-
-
-
-
+done_testing;