--- trunk/t/5_Node.t 2006/11/05 16:01:36 187 +++ trunk/t/5_Node.t 2006/11/05 16:23:03 189 @@ -3,7 +3,7 @@ use strict; use blib; -my $tests = 304; +my $tests = 311; use Test::More; use Test::Exception; @@ -277,6 +277,17 @@ } } +# test distinct +ok(my $cond = new Search::Estraier::Condition, 'new cond'); +ok($cond->set_phrase('girl'), 'cond set_phrase'); +my $distinct = '@title'; +$cond->set_distinct( $distinct ); +cmp_ok($cond->distinct, 'eq', $distinct, "distinct is $distinct"); +like($node->cond_to_query( $cond ), qr/distinct=%40title/, 'cond_to_query have distinct'); +ok( $nres = $node->search( $cond, 0 ), 'search with distinct'); +cmp_ok($nres->doc_num, '==', 1, "nres->doc_num"); +cmp_ok($nres->hits, '==', 1, "nres->hits"); +diag "nres = ", Dumper( $nres ) if ($debug); # user doesn't exist ok($node->set_user('foobar', 1), 'set_user');