--- trunk/t/swish.t 2004/12/05 12:48:00 10 +++ trunk/t/swish.t 2004/12/05 13:30:57 11 @@ -2,7 +2,7 @@ use strict; -use Test::More tests => 22; +use Test::More tests => 27; use Test::Exception; use lib '.'; use blib; @@ -36,7 +36,12 @@ ok($i->add( path => 'life', title => 'Ultimate question answer found here', - body => '42 is answer to all questions' + body => '42 is answer to all questions', + meta => { + author => 'Dobrica Pavlinusic', + date => '2004-12-05', + comment => 'woow!', + }, ), "index life"); # add one dummy document so that swish++ won't reject all words @@ -54,3 +59,12 @@ cmp_ok(scalar $i->search("title=($word)"), '==', 1, "find $word in title"); cmp_ok(scalar $i->search("$word"), '==', 1, "find $word anywhere"); } + +foreach my $word (qw(Dobrica Pavlinusic)) { + cmp_ok(scalar $i->search("author=($word)"), '==', 1, "find $word in author"); +} + +cmp_ok(scalar $i->search("date=2004-12-05"), '==', 1, "found date"); + +cmp_ok(scalar $i->search("woow!"), '==', 1, "found woow"); +cmp_ok(scalar $i->search("comment=(woow)"), '==', 1, "found woow");