KinoSearch
view release on metacpan or search on metacpan
buildlib/KinoSearch/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 = KinoSearch::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" );
core/KinoSearch/Test/TestUtils.cfh view on Meta::CPAN
*/
inert incremented PolyQuery*
make_poly_query(uint32_t boolop, ...);
/** Return the result of round-tripping the object through FREEZE and
* THAW.
*/
inert incremented Obj*
freeze_thaw(Obj *object);
/** Verify an Analyzer's transform, transform_text, and split methods.
*/
inert void
test_analyzer(TestBatch *batch, Analyzer *analyzer, CharBuf *source,
VArray *expected, char *message);
}
__C__
#define KINO_TESTUTILS_BOOLOP_OR 1
#define KINO_TESTUTILS_BOOLOP_AND 2
( run in 2.265 seconds using v1.01-cache-2.11-cpan-71847e10f99 )