/[Search-Estraier]/trunk/t/2_Condition.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/t/2_Condition.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 97 by dpavlin, Thu Jan 5 13:55:55 2006 UTC revision 98 by dpavlin, Sat Jan 28 19:18:13 2006 UTC
# Line 3  Line 3 
3  use strict;  use strict;
4  use blib;  use blib;
5    
6  use Test::More tests => 22;  use Test::More tests => 31;
7  use Test::Exception;  use Test::Exception;
8  #use Data::Dumper;  #use Data::Dumper;
9    
# Line 21  ok($cond->set_order('@foo ASC'), 'set_or Line 21  ok($cond->set_order('@foo ASC'), 'set_or
21  ok($cond->set_max(42), 'set_max, number');  ok($cond->set_max(42), 'set_max, number');
22  throws_ok { $cond->set_max('foo') } qr/number/, 'set_max, NaN';  throws_ok { $cond->set_max('foo') } qr/number/, 'set_max, NaN';
23    
24  foreach my $opt (qw/SURE USUAL FAST AGITO NOIDF SIMPLE/) {  my $old_options = -1;
25          ok($cond->set_options( $opt ), 'set_option '.$opt);  my @all_options = qw/SURE USUAL FAST AGITO NOIDF SIMPLE/;
26    my $all_opts = 0;
27    foreach my $opt (@all_options) {
28            ok(my $options = $cond->set_options( $opt ), 'set_option '.$opt);
29            cmp_ok($options, '!=', $old_options, "options changed");
30            $old_options = $options;
31            $all_opts += $options;
32  }  }
33    
34    cmp_ok($cond->set_options(@all_options), '==', $all_opts, "set_option all!");
35    
36    throws_ok { $cond->set_options('foo') } qr/foo/, "set_option invalid";
37    
38    cmp_ok($cond->set_options( SURE => 1 ), '==', $cond->set_options('SURE'), "set_option backward compatibility");
39    
40  my $v;  my $v;
41  cmp_ok($v = $cond->phrase, 'eq', 'search', "phrase: $v");  cmp_ok($v = $cond->phrase, 'eq', 'search', "phrase: $v");
42  cmp_ok($v = $cond->max, '==', 42, "max: $v");  cmp_ok($v = $cond->max, '==', 42, "max: $v");

Legend:
Removed from v.97  
changed lines
  Added in v.98

  ViewVC Help
Powered by ViewVC 1.1.26