3 |
use strict; |
use strict; |
4 |
use blib; |
use blib; |
5 |
|
|
6 |
use Test::More tests => 31; |
use Test::More tests => 37; |
7 |
use Test::Exception; |
use Test::Exception; |
8 |
use Data::Dumper; |
use Data::Dumper; |
9 |
|
|
47 |
|
|
48 |
ok($doc->add_hidden_text('This is hidden text'), 'add_hidden_text'); |
ok($doc->add_hidden_text('This is hidden text'), 'add_hidden_text'); |
49 |
|
|
50 |
throws_ok { my $text = $doc->texts } qr/return array/, 'texts scalar'; |
ok(my @texts = $doc->texts, 'texts'); |
|
ok(my @texts = $doc->texts, 'texts array'); |
|
51 |
|
|
52 |
ok(my $draft = $doc->dump_draft, 'dump_draft'); |
ok(my $draft = $doc->dump_draft, 'dump_draft'); |
53 |
|
|
81 |
ok(my $cat_text = $doc->cat_texts, 'cat_text'); |
ok(my $cat_text = $doc->cat_texts, 'cat_text'); |
82 |
#diag "cat_texts: $cat_text"; |
#diag "cat_texts: $cat_text"; |
83 |
|
|
84 |
|
ok($doc = new Search::Estraier::Document, 'new empty'); |
85 |
|
ok(! $doc->texts, 'texts'); |
86 |
|
cmp_ok($doc->dump_draft, 'eq', "\n", 'dump_draft'); |
87 |
|
cmp_ok($doc->id, '==', -1, 'id'); |
88 |
|
ok(! $doc->attr_names, 'attr_names'); |
89 |
|
ok(! $doc->attr(undef), 'attr'); |
90 |
|
ok(! $doc->cat_texts, 'cat_texts'); |
91 |
|
|
92 |
#diag Dumper($doc); |
#diag Dumper($doc); |