Skip to content

Instantly share code, notes, and snippets.

Created August 21, 2009 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/172151 to your computer and use it in GitHub Desktop.
Save anonymous/172151 to your computer and use it in GitHub Desktop.
#----------------------------------------------------------------------------
# Test that HTML entities are decoded.
$article->update({
description => "schön & cañón",
});
$indexer = WebGUI::Search::Index->create( $article );
$row = $db->quickHashRef( "SELECT * FROM assetIndex WHERE assetId=?", [ $article->getId ] );
cmp_deeply (
$row,
superhashof({
keywords => all( # keywords contains title, menuTitle, every part of the URL and every keyword
re(utf8::upgrade("cañón")),
re(utf8::upgrade("&")),
re(utf8::upgrade("schön")),
),
}),
"Index has decoded entities"
);
not ok 15 - Index has decoded entities
# Failed test 'Index has decoded entities'
# at t/Search/Index.t line 234.
# Using Regexp on (Part 1 of 3 in $data->{"keywords"})
# got : 'title menuTitle This is a synopsis root import menutitle sch?n ca??n keyword2 keyword1'
# expect : (?-xism:11)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment