Download & Extend

Test Coverage for search_simplify

Project:Drupal core
Version:7.x-dev
Component:search.module
Category:task
Priority:normal
Assigned:Unassigned
Status:closed (duplicate)

Issue Summary

This patch provides a new class for test coverage of the search_simplify function which processes text before it is inserted into the index and before it is used for searching in do_search().

AttachmentSizeStatusTest resultOperations
search_simplify_test.patch1.97 KBIdleFAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.View details | Re-test

Comments

#1

Rerolled with notes as to which test case covers which part of search_simplify and adds CJK tests.

AttachmentSizeStatusTest resultOperations
search_simplify_test.patch2.39 KBIdleFAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.View details | Re-test

#2

Reviewed, looks good to me.

#3

Status:needs review» needs work

<?php
+       '10102008' => '10-10-2008',
+      
'10102008' => '10/10/2008',
+      
'10102008' => '10.10.2008',
?>

This won't work. array keys are unique.

Try reversing the array.

#4

Must have been tired. Thanks. Rerolled.

AttachmentSizeStatusTest resultOperations
search_simplify_test.patch2.39 KBIdleFAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.View details | Re-test

#5

So that we don't run into more cases in the future like dmitrig01 found, I'd switch the key and value in the array so that it's initial => expected.

#6

Agreed.

#7

Re-rolled, switching array to initial => expected.

AttachmentSizeStatusTest resultOperations
257033_search_simplify.patch2.12 KBIdleFAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.View details | Re-test

#8

Status:needs work» needs review

#9

Be careful when you apply this patch to make sure that you don't lose the multibyte characters. I first applied it by copying the patch from my web browser (which is what I always do), and it failed the three CJK tests. However after downloading the patch using wget, it applied and passed all tests.

I also reviewed the code, and think that it's mostly ready to go. I'm one of the worst when it comes to commenting, so I'm not exactly sure what our standard is. But if I would add anything, it's that your comments aren't fully sentences and probably should be. You might get asked to change comments like "String to lowercase." to full sentences such as "Test simplification of strings to lowercase characters."

#10

Title:Test Coverage for search_simplify();» Test Coverage for search_simplify

#11

Category:feature request» task
Status:needs review» needs work

The patch applies fine and the tests run OK, but Doug's right on the comments, they need fleshing out to full sentences.

#12

Status:needs work» needs review

Setting to Needs Review so the test bot can test the last patch up there. See #11, status should actually be needs work.

#13

Status:needs review» needs work

#14

Status:needs work» closed (duplicate)

We actually now have a comprehensive search_simplify() test case in modules/search/search.test.
#604002: Poor search support of some Unicode scripts