PiRSquared17 / flaxcode

Automatically exported from code.google.com/p/flaxcode
0 stars 0 forks source link

PHP flax search client may us an incorrect test for length of returned summary #213

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Run php docs unittest
2. All succeeds, including the testBigDoc test

What is the expected output? What do you see instead?

testBigDoc contains this line:

  $this->assertTrue(count($summary) <= 500);

which will always return 1. Presumably, it should be doing this:

  $this->assertTrue(strlen($summary) <= 500);

which is testing the length of the summary string. If that is the
intention, the test will fail as the summary length will be:

 500 + (number_of_highlights * (strlen(highlight_bra) + strlen(highlight_ket)))

What should happen is that this is called first:

  $this->assertTrue(strstr($summary, '<b>Derrida</b>'));

Then the highlight start and end strings are removed, then 

  $this->assertTrue(strlen($summary) <= 500);

is called.

What version of the product are you using? On what operating system?

flax-search-clients-0.1.0-alpha

Original issue reported on code.google.com by vittalai...@googlemail.com on 16 Jun 2009 at 11:03

GoogleCodeExporter commented 9 years ago

Original comment by charliej...@gmail.com on 19 Aug 2009 at 3:01

GoogleCodeExporter commented 9 years ago

Original comment by charliej...@gmail.com on 19 Aug 2009 at 3:17