/[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 40 by dpavlin, Thu Jan 5 23:00:22 2006 UTC revision 46 by dpavlin, Fri Jan 6 01:40:04 2006 UTC
# Line 3  Line 3 
3  use strict;  use strict;
4  use blib;  use blib;
5    
6  use Test::More tests => 14;  use Test::More tests => 52;
7  use Test::Exception;  use Test::Exception;
8  use Data::Dumper;  use Data::Dumper;
9    
10  BEGIN { use_ok('Search::Estraier') };  BEGIN { use_ok('Search::Estraier') };
11    
12  my $debug = 1;  my $debug = 0;
13    
14  # name of node for test  # name of node for test
15  my $test_node = 'Search-Estraier';  my $test_node = 'Search-Estraier';
# Line 51  _END_OF_DRAFT_ Line 51  _END_OF_DRAFT_
51  #diag "draft:\n$draft";  #diag "draft:\n$draft";
52  ok(my $doc = new Search::Estraier::Document($draft), 'new doc from draft');  ok(my $doc = new Search::Estraier::Document($draft), 'new doc from draft');
53    
54  cmp_ok( $node->put_doc($doc), '==', 200, 'put_doc');  ok( $node->put_doc($doc), "put_doc data001");
55    
56    for ( 1 .. 10 ) {
57            $doc->add_attr('@uri', 'test' . $_);
58            ok( $node->put_doc($doc), "put_doc test$_");
59            #diag $doc->dump_draft;
60    }
61    
62    ok(my $id = $node->uri_to_id( 'data001' ), 'uri_to_id');
63    
64    ok( $node->out_doc( $id ), "out_doc $id");
65    
66    for ( 1 .. 5 ) {
67            ok( $node->out_doc_by_uri( 'test' . $_ ), "out_doc_by_uri test$_");
68    }
69    
70    $doc->add_attr('@uri', 'data001');
71    $doc->add_attr('foo', 'bar');
72    ok( $node->edit_doc( $doc ), 'edit_doc');
73    
74    for ( 6 .. 10 ) {
75            my $uri = 'test' . $_;
76            ok( my $id = $node->uri_to_id( $uri ), "uri_to_id $uri");
77            ok( $node->get_doc( $id ), "get_doc $id");
78            ok( $node->get_doc_by_uri( $uri ), "get_doc_by_uri $uri");
79            ok( my $k = $node->etch_doc_by_uri( $uri ), "etch_doc_by_uri $uri");
80    }

Legend:
Removed from v.40  
changed lines
  Added in v.46

  ViewVC Help
Powered by ViewVC 1.1.26