From 13c393c8f2747f2ba1ab719697a526743d7321df Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sat, 10 Jan 2015 16:35:58 +0200 Subject: [PATCH] Add more tests --- t/Zeal.t | 9 ++++++++- t/ds/b.docset/Contents/Resources/docSet.dsidx | Bin 3072 -> 3072 bytes 2 files changed, 8 insertions(+), 1 deletion(-) 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 267ae67ad439d38f3a449e06041bf5ca5a1b67df..93ac1816e8385502f1c0d5f56534b04b5e82bbd9 100644 GIT binary patch delta 166 zcmZpWXpop7&B!`Y#+i|IW5P0Kwyg}zkC?Y^7Gzn;tgFq$${;K1m{gjXlaiU29-d#6 z0%PlCl;q|prmjhC1>OpO@73#!nTcpc^mU%pzc-7UOKEmy^Jso_%$=huu6-n Qa)K0>Wah!t0-0cY0C^iY1poj5 delta 105 zcmZpWXpop7&B!uQ#+i|2W5P0KwnGfekC+c_7UWpUJh4HLU5<&BK~_|K@*Z}{$&c7o w*bXx=A7*|Gl@?-?X9Y?!f@I~GWLTv|RXLMNGjmEZ^TP9sQlLz|jFQ|O0QZ_6Hvj+t -- 2.30.2