/[Search-Estraier]/trunk/t/5_Node.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/5_Node.t

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

revision 51 by dpavlin, Fri Jan 6 13:19:50 2006 UTC revision 53 by dpavlin, Fri Jan 6 14:39:45 2006 UTC
# Line 3  Line 3 
3  use strict;  use strict;
4  use blib;  use blib;
5    
6  use Test::More tests => 87;  use Test::More tests => 88;
7  use Test::Exception;  use Test::Exception;
8  use Data::Dumper;  use Data::Dumper;
9    
# Line 75  ok( $node->out_doc( $id ), "out_doc $id" Line 75  ok( $node->out_doc( $id ), "out_doc $id"
75    
76  ok( ! $node->edit_doc( $doc ), "edit removed");  ok( ! $node->edit_doc( $doc ), "edit removed");
77    
78    my $max = 3;
79    
80  ok(my $cond = new Search::Estraier::Condition, 'new cond');  ok(my $cond = new Search::Estraier::Condition, 'new cond');
81  ok($cond->set_phrase('girl'), 'cond set_phrase');  ok($cond->set_phrase('girl'), 'cond set_phrase');
82  ok($cond->set_max(42), 'cond set_max');  ok($cond->set_max($max), "cond set_max $max");
83  ok($cond->set_order('@uri ASCD'), 'cond set_order');  ok($cond->set_order('@uri ASCD'), 'cond set_order');
84  ok($cond->add_attr('@title STRINC Material'), 'cond add_attr');  ok($cond->add_attr('@title STRINC Material'), 'cond add_attr');
85    
86  cmp_ok($node->cond_to_query( $cond ), 'eq' , 'phrase=girl&attr1=%40title%20STRINC%20Material&order=%40uri%20ASCD&max=42&wwidth=480&hwidth=96&awidth=96', 'cond_to_query');  cmp_ok($node->cond_to_query( $cond ), 'eq' , 'phrase=girl&attr1=%40title%20STRINC%20Material&order=%40uri%20ASCD&max='.$max.'&wwidth=480&hwidth=96&awidth=96', 'cond_to_query');
87    
88  ok( my $nrec = $node->search( $cond, 0 ), 'search');  ok( my $nrec = $node->search( $cond, 0 ), 'search');
89    
90  isa_ok( $nrec, 'Search::Estraier::NodeResult' );  isa_ok( $nrec, 'Search::Estraier::NodeResult' );
91    
92    cmp_ok($nrec->doc_num, '==', $max, "doc_num = $max");
93    
94  for ( 6 .. 10 ) {  for ( 6 .. 10 ) {
95          my $uri = 'test' . $_;          my $uri = 'test' . $_;
96          ok( my $id = $node->uri_to_id( $uri ), "uri_to_id $uri");          ok( my $id = $node->uri_to_id( $uri ), "uri_to_id $uri");

Legend:
Removed from v.51  
changed lines
  Added in v.53

  ViewVC Help
Powered by ViewVC 1.1.26