From: Marius Gavrilescu Date: Sat, 10 Jan 2015 14:35:58 +0000 (+0200) Subject: Add more tests X-Git-Tag: 0.000_003~2 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=13c393c8f2747f2ba1ab719697a526743d7321df;p=zeal.git Add more tests --- diff --git a/t/Zeal.t b/t/Zeal.t index 5bbf7a5..abe7f46 100644 --- a/t/Zeal.t +++ b/t/Zeal.t @@ -2,7 +2,7 @@ use strict; use warnings; -use Test::More tests => 18; +use Test::More tests => 20; BEGIN { use_ok('Zeal') }; note 'Working with t/ds/b.docset'; @@ -17,6 +17,7 @@ my $doc = $ds->query('building'); is $doc->name, 'building', 'document name is building'; is $doc->type, 'Word', 'document type is Word'; like $doc->fetch, qr/^Dummy/, 'document HTML starts with "Dummy"'; +is $doc->anchor, 'dummy_anchor', 'document anchor is dummy_anchor'; @results = sort {$a->name cmp $b->name} $ds->list; is @results, 2, 'docset contains two documents'; @@ -24,6 +25,12 @@ is $results[0]->name, 'building', 'first result is "building"'; note 'Working with all docsets in t/ds/'; my $zeal = Zeal->new('t/ds/'); +eval { + $zeal->query('family:term'); + fail 'An exception was not thrown when searching for a nonexistent family'; + 1 +} or like $@, qr/^No docsets/, 'An exception is thrown when searching for a nonexistent family'; + my @sets = $zeal->sets; is @sets, 3, '3 docsets loaded'; @results = $zeal->query('buil%'); diff --git a/t/ds/b.docset/Contents/Resources/docSet.dsidx b/t/ds/b.docset/Contents/Resources/docSet.dsidx index 267ae67..93ac181 100644 Binary files a/t/ds/b.docset/Contents/Resources/docSet.dsidx and b/t/ds/b.docset/Contents/Resources/docSet.dsidx differ