App-CSE
view release on metacpan or search on metacpan
t/05-more-search.t view on Meta::CPAN
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 got one hit");
}
{
## Searching a java file
local @ARGV = ( '--idx='.$idx_dir, 'Java mime:text/x-java');
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 got one hit");
}
{
## Searching a scala file
local @ARGV = ( '--idx='.$idx_dir, 'scala mime:text/x-scala');
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 got one hit");
}
{
## Searching a scala file excluding declaration
local @ARGV = ( '--idx='.$idx_dir, 'scala -decl:FooClass mime:text/x-scala');
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() , 0, "Ok no hit because FooClass is in declarations");
}
{
## Searching for CSharp
local @ARGV = ( '--idx='.$idx_dir, 'CSHarp mime:text/x-csharp');
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 got one hit");
}
{
## Searching for php_test
local @ARGV = ( '--idx='.$idx_dir, 'php_test');
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 got one hit");
}
{
## Searching for pythonesque
local @ARGV = ( '--idx='.$idx_dir, 'pythonesque');
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 got one hit");
}
{
## Searching for hypertext (from the XHTML file).
local @ARGV = ( '--idx='.$idx_dir, 'HyperText');
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 got one hit");
}
{
## Searching for this_is_an_html_file (from the HTML file).
local @ARGV = ( '--idx='.$idx_dir, 'This_is_an_html_file');
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 got one hit");
}
{
## Searching for c_plus_plus (from the .cc and .cpp file).
local @ARGV = ( '--idx='.$idx_dir, 'c_plus_plus');
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 got two hits. One from the .cc and one from the .cpp");
}
{
## Searching for head_h (from the .h file).
local @ARGV = ( '--idx='.$idx_dir, 'head_h');
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 got one hit");
}
ok(1);
done_testing();
( run in 3.303 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )