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

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

revision 25 by dpavlin, Thu Jan 5 13:55:55 2006 UTC revision 26 by dpavlin, Thu Jan 5 15:05:58 2006 UTC
# Line 3  Line 3 
3  use strict;  use strict;
4  use blib;  use blib;
5    
6  use Test::More tests => 33;  use Test::More tests => 31;
7  use Test::Exception;  use Test::Exception;
8  use Data::Dumper;  use Data::Dumper;
9    
# Line 52  ok(my @texts = $doc->texts, 'texts array Line 52  ok(my @texts = $doc->texts, 'texts array
52    
53  ok(my $draft = $doc->dump_draft, 'dump_draft');  ok(my $draft = $doc->dump_draft, 'dump_draft');
54    
55  diag "dump_draft:\n$draft";  #diag "dump_draft:\n$draft";
56    
57  ok(my $doc2 = new Search::Estraier::Document($draft), 'new from draft');  ok(my $doc2 = new Search::Estraier::Document($draft), 'new from draft');
58  cmp_ok($doc2->dump_draft, 'eq', $draft, 'drafts same');  cmp_ok($doc2->dump_draft, 'eq', $draft, 'drafts same');
# Line 61  cmp_ok($doc->id, '==', -1, 'id'); Line 61  cmp_ok($doc->id, '==', -1, 'id');
61  cmp_ok($doc2->id, '==', -1, 'id');  cmp_ok($doc2->id, '==', -1, 'id');
62    
63  ok(my @attr = $doc->attr_names, 'attr_names');  ok(my @attr = $doc->attr_names, 'attr_names');
64  diag "attr_names: ", join(',',@attr), "\n";  #diag "attr_names: ", join(',',@attr), "\n";
65    
66  cmp_ok(scalar @attr, '==', 2, 'attr_names');  cmp_ok(scalar @attr, '==', 2, 'attr_names');
67    
# Line 76  foreach my $a (keys %{$attr_data}) { Line 76  foreach my $a (keys %{$attr_data}) {
76  #diag "attr_names left: ", join(',',$doc->attr_names), "\n";  #diag "attr_names left: ", join(',',$doc->attr_names), "\n";
77  cmp_ok(@attr, '==' , 0, "attributes removed");  cmp_ok(@attr, '==' , 0, "attributes removed");
78    
79  diag "texts: ", join(',',@texts), "\n";  #diag "texts: ", join(',',@texts), "\n";
80  ok(eq_array(\@test_texts, \@texts), 'texts');  ok(eq_array(\@test_texts, \@texts), 'texts');
81    
82  ok(my $cat_text = $doc->cat_texts, 'cat_text');  ok(my $cat_text = $doc->cat_texts, 'cat_text');
83  diag "cat_texts: $cat_text";  #diag "cat_texts: $cat_text";
   
   
 SKIP: {  
         skip "est_keywords not implemented", 2;  
   
         my @keywords = $doc->keywords;  
         diag "keywords: ", join(',',@keywords), "\n";  
   
         cmp_ok(scalar @keywords, '==', 1, 'keywords');  
 }  
   
   
 #ok(my $snippet = $doc->make_snippet(480, 96, 96, qw(demo is)), "make_snippet");  
 #diag "make_snippet:\n$snippet";  
   
 #ok($doc->scan_words(qw(this is demo)), "scan_words");  
84    
85  #diag Dumper($doc);  #diag Dumper($doc);

Legend:
Removed from v.25  
changed lines
  Added in v.26

  ViewVC Help
Powered by ViewVC 1.1.26