1 |
#!/usr/bin/perl -w |
2 |
|
3 |
use strict; |
4 |
use blib; |
5 |
|
6 |
use Test::More tests => 14; |
7 |
use Test::Exception; |
8 |
#use Data::Dumper; |
9 |
|
10 |
BEGIN { use_ok('Search::Estraier') }; |
11 |
|
12 |
ok(my $cond = new Search::Estraier::Condition, 'new'); |
13 |
isa_ok($cond, 'Search::Estraier::Condition'); |
14 |
|
15 |
ok($cond->set_phrase('search'), 'set_phrase'); |
16 |
ok($cond->add_attr('@foo BAR baz'), 'set_phrase'); |
17 |
ok($cond->set_order('@foo ASC'), 'set_order'); |
18 |
ok($cond->set_max(42), 'set_max, number'); |
19 |
throws_ok { $cond->set_max('foo') } qr/number/, 'set_max, NaN'; |
20 |
|
21 |
foreach my $opt (qw/SURE USUAL FAST AGITO NOIDF SIMPLE/) { |
22 |
ok($cond->set_options( $opt ), 'set_option '.$opt); |
23 |
} |