/[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 149 by dpavlin, Mon May 15 22:06:14 2006 UTC revision 150 by dpavlin, Mon May 15 22:26:08 2006 UTC
# Line 3  Line 3 
3  use strict;  use strict;
4  use blib;  use blib;
5    
6  use Test::More tests => 246;  use Test::More tests => 252;
7  use Test::Exception;  use Test::Exception;
8  use Data::Dumper;  use Data::Dumper;
9    
# Line 151  $doc->add_attr('foo', 'bar'); Line 151  $doc->add_attr('foo', 'bar');
151  #diag Dumper($doc);  #diag Dumper($doc);
152  ok( $node->edit_doc( $doc ), 'edit_doc');  ok( $node->edit_doc( $doc ), 'edit_doc');
153    
154    my $doc_num;
155    ok( $doc_num = $node->doc_num, "node->doc_num $doc_num");
156    
157  ok( $node->out_doc( $id ), "out_doc($id)");  ok( $node->out_doc( $id ), "out_doc($id)");
158    
159  ok( ! $node->edit_doc( $doc ), "edit_doc of removed doc");  cmp_ok( $node->doc_num, '==', --$doc_num, "node->doc_num " . $doc_num);
160    
161  my $doc_num;  ok( ! $node->edit_doc( $doc ), "edit_doc of removed doc");
 ok( $doc_num = $node->doc_num, "node->doc_num $doc_num");  
162    
163  my $delete_num = 5;  my $delete_num = 5;
164    
165  for ( 1 .. $delete_num ) {  for ( 1 .. $delete_num ) {
166          ok( $node->out_doc_by_uri( 'test' . $_ ), "out_doc_by_uri test$_");          ok( $node->out_doc_by_uri( 'test' . $_ ), "out_doc_by_uri test$_");
167            cmp_ok( $node->doc_num, '==', $doc_num - $_, "node->doc_num " . ($doc_num - $_));
168  }  }
169    
170  ok($msg = $node->master( action => 'sync' ), "sync: $msg");  ok($msg = $node->master( action => 'sync' ), "sync: $msg");
# Line 202  for my $i ( 0 .. ($nres->hits - 1) ) { Line 205  for my $i ( 0 .. ($nres->hits - 1) ) {
205                  ok( my $k = $rdoc->keywords( $id ), "rdoc keywords");                  ok( my $k = $rdoc->keywords( $id ), "rdoc keywords");
206          } else {          } else {
207                  ok( ! $nres->get_doc( $i ), "nres->get_doc doesn't exist");                  ok( ! $nres->get_doc( $i ), "nres->get_doc doesn't exist");
   
208          }          }
209    
210          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.149  
changed lines
  Added in v.150

  ViewVC Help
Powered by ViewVC 1.1.26