App-CSE

 view release on metacpan or  search on metacpan

t/07-decl.t  view on Meta::CPAN

{
  ## Searching for some_method
  local @ARGV = (  '--idx='.$idx_dir, 'some_method', '--dir='.$content_dir.'');
  my $cse = App::CSE->new();
  is( $cse->command()->execute(), 0 , "Ok execute has terminated just fine");
  ok( $cse->command()->hits() , "Ok got hits");
  is( $cse->command()->hits()->total_hits() , 2 , "Ok two hits");
}

SKIP: {
    skip "Perl too old.", 3  unless ( $] ge '5.14' );
    ## Searching for some method, but excluding the declaration
    local @ARGV = (  '--idx='.$idx_dir, 'some_method', '-decl:some_method', '--dir='.$content_dir.'');
    my $cse = App::CSE->new();
    is( $cse->command()->execute(), 0 , "Ok execute has terminated just fine");
    ok( $cse->command()->hits() , "Ok got hits");
    is( $cse->command()->hits()->total_hits() , 1 , "Ok one hit only");
};

ok(1);
done_testing();



( run in 1.154 second using v1.01-cache-2.11-cpan-b61123c0432 )