/[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 114 by dpavlin, Tue Feb 21 15:40:54 2006 UTC revision 115 by dpavlin, Sun Mar 12 18:42:34 2006 UTC
# Line 3  Line 3 
3  use strict;  use strict;
4  use blib;  use blib;
5    
6  use Test::More tests => 106;  use Test::More tests => 115;
7  use Test::Exception;  use Test::Exception;
8  use Data::Dumper;  use Data::Dumper;
9    
# Line 100  cmp_ok($nres->doc_num, '==', $max, "doc_ Line 100  cmp_ok($nres->doc_num, '==', $max, "doc_
100    
101  cmp_ok($nres->hits, '==', $data_max, "hits");  cmp_ok($nres->hits, '==', $data_max, "hits");
102    
103  for ( 6 .. 10 ) {  for my $i ( 0 .. ($nres->hits - 1) ) {
104          my $uri = 'test' . $_;          my $uri = 'test' . ($i + $data_max + 1);
105    
106            if ($i < $nres->doc_num) {
107                    ok( my $rdoc = $nres->get_doc( $i ), "get_doc $i");
108    
109                    cmp_ok( $rdoc->attr('@uri'), 'eq', $uri, "\@uri = $uri");
110                    ok( my $k = $rdoc->keywords( $id ), "rdoc keywords");
111            }
112    
113          ok( my $id = $node->uri_to_id( $uri ), "uri_to_id($uri) = $id");          ok( my $id = $node->uri_to_id( $uri ), "uri_to_id($uri) = $id");
114          ok( $node->get_doc( $id ), "get_doc $id");          ok( $node->get_doc( $id ), "get_doc $id");
115          ok( $node->get_doc_by_uri( $uri ), "get_doc_by_uri $uri");          ok( $node->get_doc_by_uri( $uri ), "get_doc_by_uri $uri");
116          cmp_ok( $node->get_doc_attr( $id, '@uri' ), 'eq', $uri, "get_doc_attr $id");          cmp_ok( $node->get_doc_attr( $id, '@uri' ), 'eq', $uri, "get_doc_attr $id");
117          cmp_ok( $node->get_doc_attr_by_uri( $uri, '@uri' ), 'eq', $uri, "get_doc_attr $id");          cmp_ok( $node->get_doc_attr_by_uri( $uri, '@uri' ), 'eq', $uri, "get_doc_attr $id");
118          ok( my $k = $node->etch_doc( $id ), "etch_doc_by_uri $uri");          ok( my $k1 = $node->etch_doc( $id ), "etch_doc_by_uri $uri");
119          ok( my $k2 = $node->etch_doc_by_uri( $uri ), "etch_doc_by_uri $uri");          ok( my $k2 = $node->etch_doc_by_uri( $uri ), "etch_doc_by_uri $uri");
120          #diag Dumper($k, $k2);          #diag Dumper($k, $k2);
121          ok( eq_hash( $k, $k2 ), "keywords");          ok( eq_hash( $k1, $k2 ), "keywords");
122  }  }
123    
124  ok(my $hints = $nres->hints, 'hints');  ok(my $hints = $nres->hints, 'hints');

Legend:
Removed from v.114  
changed lines
  Added in v.115

  ViewVC Help
Powered by ViewVC 1.1.26