Skip to content

Commit

Permalink
Item13738: Fix unit tests for search encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
gac410 committed Sep 26, 2015
1 parent 824b756 commit 7451ccf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions UnitTestContrib/test/unit/Fn_SEARCH.pm
Expand Up @@ -2889,7 +2889,7 @@ sub verify_Search_expression {
$this->{test_topicObject}->expandMacros(
'%SEARCH{"TestForm.Ecks~\'Bl>ah*\'" type="query" nototal="on"}%');
my $expected = $this->toSiteCharSet(<<'HERE');
<div class="foswikiSearchResultsHeader"><span>Searched: <b><noautolink>TestForm.Ecks~'Bl&gt;ah*'</noautolink></b></span><span id="foswikiNumberOfResultsContainer"></span></div>
<div class="foswikiSearchResultsHeader"><span>Searched: <b><noautolink>TestForm.Ecks~&#39;Bl&#62;ah&#42;&#39;</noautolink></b></span><span id="foswikiNumberOfResultsContainer"></span></div>
HERE

$this->assert_str_equals( $expected, $actual );
Expand All @@ -2898,7 +2898,7 @@ HERE
$this->{test_topicObject}->expandMacros(
'%SEARCH{"TestForm.Ecks = \'B/lah*\'" type="query" nototal="on"}%');
$expected = $this->toSiteCharSet(<<'HERE');
<div class="foswikiSearchResultsHeader"><span>Searched: <b><noautolink>TestForm.Ecks = 'B/lah*'</noautolink></b></span><span id="foswikiNumberOfResultsContainer"></span></div>
<div class="foswikiSearchResultsHeader"><span>Searched: <b><noautolink>TestForm.Ecks &#61; &#39;B/lah&#42;&#39;</noautolink></b></span><span id="foswikiNumberOfResultsContainer"></span></div>
HERE
$this->assert_str_equals( $expected, $actual );

Expand Down Expand Up @@ -6907,7 +6907,7 @@ HERE
$this->assert( 0, $result )
unless $result =~ /Number of topics: <span>(\d+)<\/span>/;
$this->assert( 0, $result )
unless $result =~ /Searched: <b><noautolink>'<\/noautolink><\/b>/;
unless $result =~ /Searched: <b><noautolink>&#39;<\/noautolink><\/b>/;

$search = <<'HERE';
%SEARCH{
Expand All @@ -6925,7 +6925,7 @@ HERE
unless $result =~ /Number of topics: <span>(\d+)<\/span>/;
$this->assert( 0, $result )
unless $result =~
/Searched: <b><noautolink>' " &lt; &gt; and %<\/noautolink><\/b>/;
/Searched: <b><noautolink>&#39; &#34; &#60; &#62; and &#37;<\/noautolink><\/b>/;

$search = <<'HERE';
%SEARCH{
Expand All @@ -6942,7 +6942,7 @@ HERE
$this->assert( 0, $result )
unless $result =~ /Number of topics: <span>(\d+)<\/span>/;
$this->assert( 0, $result )
unless $result =~ /Searched: <b><noautolink>'<\/noautolink><\/b>/;
unless $result =~ /Searched: <b><noautolink>&#39;<\/noautolink><\/b>/;

$search = <<'HERE';
%SEARCH{
Expand All @@ -6959,7 +6959,7 @@ HERE
$this->assert( 0, $result )
unless $result =~ /Number of topics: <span>(\d+)<\/span>/;
$this->assert( 0, $result )
unless $result =~ /Searched: <b><noautolink>'<\/noautolink><\/b>/;
unless $result =~ /Searched: <b><noautolink>&#39;<\/noautolink><\/b>/;

return;
}
Expand Down
4 changes: 2 additions & 2 deletions core/data/TestCases/TestCaseAutoFormattedSearchDetails.txt
Expand Up @@ -11,7 +11,7 @@ The major risk is the default formatting where web's are separated - for paging
---++ default search formatting - 1 expand rex old Tmwiki default multi-weboutput 4 webs
---+++ Expected
<!-- expected 1 expand rex old Tmwiki default multi-weboutput 4 webs -->
<div class="foswikiSearchResultsHeader"><span>Searched: <b><noautolink>(WebPreferences|WebTopicList|WebHome)$</noautolink></b></span><span id="foswikiNumberOfResultsContainer"></span></div>
<div class="foswikiSearchResultsHeader"><span>Searched: <b><noautolink>(WebPreferences&#124;WebTopicList&#124;WebHome)$</noautolink></b></span><span id="foswikiNumberOfResultsContainer"></span></div>


<h4 class="foswikiSearchResultsHeader" style="border-color:#FFEFA6"><b>Results from Main web</b> retrieved at @TIME (@REX(GMT|Local)</h4>
Expand Down Expand Up @@ -126,7 +126,7 @@ The major risk is the default formatting where web's are separated - for paging
(shows separator is ignored if format isn't set)
---+++ Expected
<!-- DISABLE expected expand rex old Tmwiki format, and sep multi-weboutput 4 webs -->
<div class="foswikiSearchResultsHeader"><span>Searched: <b><noautolink>(WebPreferences|WebTopicList|WebHome)$</noautolink></b></span><span id="foswikiNumberOfResultsContainer"></span></div>
<div class="foswikiSearchResultsHeader"><span>Searched: <b><noautolink>(WebPreferences&#124;WebTopicList&#124;WebHome)$</noautolink></b></span><span id="foswikiNumberOfResultsContainer"></span></div>

<h4 class="foswikiSearchResultsHeader" style="border-color:yellow"><b>Results from TestCases web</b> retrieved at @TIME (@REX(GMT|Local)</h4>
<div class="foswikiSearchResult"><div class="foswikiTopRow">
Expand Down

0 comments on commit 7451ccf

Please sign in to comment.