3 |
use strict; |
use strict; |
4 |
use blib; |
use blib; |
5 |
|
|
6 |
use Test::More tests => 29; |
use Test::More tests => 33; |
7 |
use Test::Exception; |
use Test::Exception; |
8 |
use Data::Dumper; |
use Data::Dumper; |
9 |
|
|
54 |
|
|
55 |
diag "dump_draft:\n$draft"; |
diag "dump_draft:\n$draft"; |
56 |
|
|
57 |
#ok(my $doc2 = new_from_draft 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'); |
59 |
|
|
60 |
cmp_ok($doc->id, '==', -1, 'id'); |
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"; |
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'); |
83 |
|
diag "cat_texts: $cat_text"; |
84 |
|
|
85 |
|
|
86 |
SKIP: { |
SKIP: { |
87 |
skip "est_keywords not implemented", 2; |
skip "est_keywords not implemented", 2; |
88 |
|
|
98 |
|
|
99 |
#ok($doc->scan_words(qw(this is demo)), "scan_words"); |
#ok($doc->scan_words(qw(this is demo)), "scan_words"); |
100 |
|
|
101 |
diag Dumper($doc); |
#diag Dumper($doc); |