skip ideogram tests if mysql is configured badly
This commit is contained in:
parent
81ffc16f63
commit
9abeae359a
2 changed files with 29 additions and 18 deletions
|
|
@ -57,9 +57,13 @@ ok(! $search->_isStopword('private.+'), '_isStopword: regex metacharacters
|
||||||
# Chinese ideograph handling
|
# Chinese ideograph handling
|
||||||
#
|
#
|
||||||
################################################
|
################################################
|
||||||
{
|
SKIP: {
|
||||||
use utf8;
|
use utf8;
|
||||||
|
|
||||||
|
my $min_word_length = $session->db->quickScalar('SELECT @@ft_min_word_len');
|
||||||
|
skip 'MySQL minimum word length too long to support ideograms', 2
|
||||||
|
if $min_word_length > 2;
|
||||||
|
|
||||||
# Create an article to index
|
# Create an article to index
|
||||||
my $article = WebGUI::Asset->getImportNode( $session )->addChild( {
|
my $article = WebGUI::Asset->getImportNode( $session )->addChild( {
|
||||||
className => 'WebGUI::Asset::Wobject::Article',
|
className => 'WebGUI::Asset::Wobject::Article',
|
||||||
|
|
|
||||||
|
|
@ -244,23 +244,30 @@ cmp_deeply (
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# Test that Chinese ideographical characters are inserted and searchable.
|
# Test that Chinese ideographical characters are inserted and searchable.
|
||||||
use utf8;
|
SKIP: {
|
||||||
$article->update({
|
use utf8;
|
||||||
description => "甲骨文",
|
|
||||||
});
|
|
||||||
$indexer = WebGUI::Search::Index->create( $article );
|
|
||||||
|
|
||||||
$row = $db->quickHashRef( "SELECT * FROM assetIndex WHERE assetId=?", [ $article->getId ] );
|
my $min_word_length = $session->db->quickScalar('SELECT @@ft_min_word_len');
|
||||||
cmp_deeply (
|
skip 'MySQL minimum word length too long to support ideograms', 1
|
||||||
$row,
|
if $min_word_length > 2;
|
||||||
superhashof({
|
|
||||||
keywords => all( # keywords contains title, menuTitle, every part of the URL and every keyword
|
$article->update({
|
||||||
re("''甲''"),
|
description => "甲骨文",
|
||||||
re("''骨''"),
|
});
|
||||||
re("''文''"),
|
$indexer = WebGUI::Search::Index->create( $article );
|
||||||
),
|
|
||||||
}),
|
$row = $db->quickHashRef( "SELECT * FROM assetIndex WHERE assetId=?", [ $article->getId ] );
|
||||||
"Index has Chinese ideographs, separated by spaces and delimited with quotes to pad the length"
|
cmp_deeply (
|
||||||
);
|
$row,
|
||||||
|
superhashof({
|
||||||
|
keywords => all( # keywords contains title, menuTitle, every part of the URL and every keyword
|
||||||
|
re("''甲''"),
|
||||||
|
re("''骨''"),
|
||||||
|
re("''文''"),
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
"Index has Chinese ideographs, separated by spaces and delimited with quotes to pad the length"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#vim:ft=perl
|
#vim:ft=perl
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue