--- trunk/t/2_condition.t 2006/01/04 22:24:57 15 +++ trunk/t/2_condition.t 2006/01/04 22:48:29 18 @@ -3,8 +3,8 @@ use strict; use blib; -use Test::More tests => 3; -#use Test::Exception; +use Test::More tests => 15; +use Test::Exception; #use Data::Dumper; BEGIN { use_ok('Search::Estraier') }; @@ -12,3 +12,14 @@ ok(my $cond = new Search::Estraier::Condition, 'new'); isa_ok($cond, 'Search::Estraier::Condition'); +ok($cond->set_phrase('search'), 'set_phrase'); +ok($cond->add_attr('@foo BAR baz'), 'set_phrase'); +ok($cond->set_order('@foo ASC'), 'set_order'); +ok($cond->set_max(42), 'set_max, number'); +throws_ok { $cond->set_max('foo') } qr/number/, 'set_max, NaN'; + +foreach my $opt (qw/SURE USUAL FAST AGITO NOIDF SIMPLE/) { + ok($cond->set_options( $opt ), 'set_option '.$opt); +} + +cmp_ok($cond->phrase, 'eq', 'search', 'phrase');