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().

Comments

BlakeLucchesi’s picture

StatusFileSize
new2.39 KB

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

cfennell’s picture

Reviewed, looks good to me.

dmitrig01’s picture

Status: Needs review » Needs work
+       '10102008' => '10-10-2008',
+       '10102008' => '10/10/2008',
+       '10102008' => '10.10.2008',

This won't work. array keys are unique.

Try reversing the array.

BlakeLucchesi’s picture

StatusFileSize
new2.39 KB

Must have been tired. Thanks. Rerolled.

douggreen’s picture

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.

dmitrig01’s picture

Agreed.

David Lesieur’s picture

StatusFileSize
new2.12 KB

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

David Lesieur’s picture

Status: Needs work » Needs review
douggreen’s picture

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."

douggreen’s picture

Title: Test Coverage for search_simplify(); » Test Coverage for search_simplify
catch’s picture

Category: feature » 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.

jhodgdon’s picture

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.

jhodgdon’s picture

Status: Needs review » Needs work
jhodgdon’s picture

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