--- trunk/t/5_Node.t 2006/01/05 23:32:31 41 +++ trunk/t/5_Node.t 2006/01/06 01:40:04 46 @@ -3,7 +3,7 @@ use strict; use blib; -use Test::More tests => 34; +use Test::More tests => 52; use Test::Exception; use Data::Dumper; @@ -51,14 +51,30 @@ #diag "draft:\n$draft"; ok(my $doc = new Search::Estraier::Document($draft), 'new doc from draft'); +ok( $node->put_doc($doc), "put_doc data001"); + for ( 1 .. 10 ) { $doc->add_attr('@uri', 'test' . $_); ok( $node->put_doc($doc), "put_doc test$_"); #diag $doc->dump_draft; } -ok( $node->out_doc( 0 ), 'out_doc'); +ok(my $id = $node->uri_to_id( 'data001' ), 'uri_to_id'); -for ( 1 .. 10 ) { - ok( $node->out_doc_by_uri( 'test' .$_ ), "out_doc_by_uri test$_"); +ok( $node->out_doc( $id ), "out_doc $id"); + +for ( 1 .. 5 ) { + ok( $node->out_doc_by_uri( 'test' . $_ ), "out_doc_by_uri test$_"); +} + +$doc->add_attr('@uri', 'data001'); +$doc->add_attr('foo', 'bar'); +ok( $node->edit_doc( $doc ), 'edit_doc'); + +for ( 6 .. 10 ) { + my $uri = 'test' . $_; + ok( my $id = $node->uri_to_id( $uri ), "uri_to_id $uri"); + ok( $node->get_doc( $id ), "get_doc $id"); + ok( $node->get_doc_by_uri( $uri ), "get_doc_by_uri $uri"); + ok( my $k = $node->etch_doc_by_uri( $uri ), "etch_doc_by_uri $uri"); }