Skip to content

Commit f1b8e85

Browse files
committed
Searching: Added test for guillemets
To cover #5475
1 parent c291d27 commit f1b8e85

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/Search/SearchIndexingTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,22 @@ public function test_tag_names_and_values_are_indexed_for_search()
7575
$this->assertEquals(3, $scoreByTerm->get('SuperImportant'));
7676
}
7777

78+
public function test_terms_containing_guillemets_handled()
79+
{
80+
$page = $this->entities->newPage(['html' => '<p>«Hello there» and « there »</p>']);
81+
82+
$scoreByTerm = $page->searchTerms()->pluck('score', 'term');
83+
$expected = ['Hello', 'there', 'and'];
84+
foreach ($expected as $term) {
85+
$this->assertNotNull($scoreByTerm->get($term), "Failed asserting that \"$term\" is indexed");
86+
}
87+
88+
$nonExpected = ['«', '»'];
89+
foreach ($nonExpected as $term) {
90+
$this->assertNull($scoreByTerm->get($term), "Failed asserting that \"$term\" is not indexed");
91+
}
92+
}
93+
7894
public function test_terms_containing_punctuation_within_retain_original_form_and_split_form_in_index()
7995
{
8096
$page = $this->entities->newPage(['html' => '<p>super.duper awesome-beans big- barry cheese.</p><p>biscuits</p><p>a-bs</p>']);

0 commit comments

Comments
 (0)