Lucy
view release on metacpan or search on metacpan
buildlib/Lucy/Test/TestUtils.pm view on Meta::CPAN
# Return 3 strings useful for verifying UTF-8 integrity.
sub utf8_test_strings {
my $smiley = "\x{263a}";
my $not_a_smiley = $smiley;
_utf8_off($not_a_smiley);
my $frowny = $not_a_smiley;
utf8::upgrade($frowny);
return ( $smiley, $not_a_smiley, $frowny );
}
# Verify an Analyzer's transform, transform_text, and split methods.
sub test_analyzer {
my ( $analyzer, $source, $expected, $message ) = @_;
my $inversion = Lucy::Analysis::Inversion->new( text => $source );
$inversion = $analyzer->transform($inversion);
my @got;
while ( my $token = $inversion->next ) {
push @got, $token->get_text;
}
Test::More::is_deeply( \@got, $expected, "analyze: $message" );
cftest/Lucy/Test/TestUtils.cfh view on Meta::CPAN
bool include_upper = true);
/** Return either an ORQuery or an ANDQuery depending on the value of
* `boolop`. Takes a NULL-terminated list of Query objects.
* Decrements the refcounts of all supplied children, under the assumption
* that they were created solely for inclusion within the aggregate query.
*/
inert incremented PolyQuery*
make_poly_query(uint32_t boolop, ...);
/** Verify an Analyzer's transform, transform_text, and split methods.
*/
inert void
test_analyzer(TestBatchRunner *runner, Analyzer *analyzer, String *source,
Vector *expected, const char *message);
/** Return the "modules" folder.
*
* If the folder cannot be found, return NULL.
*/
inert incremented nullable FSFolder*
( run in 1.173 second using v1.01-cache-2.11-cpan-71847e10f99 )