X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=t%2F7-est.t;h=bc61623472b41011a543abb88a62d16765ddcc13;hb=b75178216f8de53481659bc84647f023dd9d5829;hp=9e8463fa5d73a04e8ccbecf6a7984f298cefd0a7;hpb=dfd016b241b00b8077f8479f1e7cf7c00e493926;p=webpac2 diff --git a/t/7-est.t b/t/7-est.t index 9e8463f..bc61623 100755 --- a/t/7-est.t +++ b/t/7-est.t @@ -2,11 +2,11 @@ use strict; -use Test::More tests => 11; +use Test::More tests => 13; use Test::Exception; use Cwd qw/abs_path/; use File::Temp qw/tempdir/; -use Data::Dumper; +use Data::Dump; use blib; BEGIN { @@ -30,10 +30,6 @@ my $config = { ok(my $est = new WebPAC::Output::Estraier( %{ $config } ), "new WebPAC::Output::Estraier"); -ok(my $list = $est->est_master( action => 'nodelist' ), "nodelist"); - -like($list , qr/$config->{database}/, "found $config->{database}"); - my $ds = { 'Source' => { 'name' => 'Izvor: ', @@ -54,12 +50,12 @@ my $ds = { ok($est->add( id => 42, ds => $ds, type => 'search' ), "add"); -ok($est = new WebPAC::Search::Estraier( %{ $config } ), "new WebPAC::Search::Estraier"); +ok(my $est_s = new WebPAC::Search::Estraier( %{ $config } ), "new WebPAC::Search::Estraier"); my $query = 'demo'; my $max = 1; -ok(my @res = $est->search( +ok(my @res = $est_s->search( phrase => $query, get_attr => [ qw/ID Source/ ], max => $max, @@ -67,5 +63,10 @@ ok(my @res = $est->search( cmp_ok(($#res + 1), '==', $max, "$max hits"); -diag Dumper(\@res); +ok($est->master( action => 'nodeadd', name => 'webpac2test_link', label => 'test' ), "nodeadd"); + +ok($est->add_link( from => 'webpac2test', to => 'webpac2test_link', credit => 42 ), "add_link"); + +ok($est->master( action => 'nodedel', name => 'webpac2test' ), "nodedel"); +ok($est->master( action => 'nodedel', name => 'webpac2test_link' ), "nodedel");