zkendall commented on code in PR #13384:
URL: https://github.com/apache/lucene/pull/13384#discussion_r1606176560
##########
lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestDefaultPassageFormatter.java:
##########
@@ -52,4 +53,25 @@ public void testBasic() throws Exception {
+ "</div> of this <u>very</u> formatter.\u2026
It's not <u>very</u> N/A!",
formatter.format(passages, text));
}
+
Review Comment:
Added new test. Essentially a copy scenario of what is tested in the other
modified test (TestUnifiedHighlighterStrictPhrases). However, this tests
directly the changed class (DefaultPassageFormatter), so I figured worth the
addition.
Without the fix, DefaultPassageFormatter fails like this
```
Expected :<b>Yin yang loooooooooong</b>, <b>yin</b> gap <b>yang</b> yong
Actual :<b>Yin yang</b> <b>loooooooooong</b>, <b>yin</b> gap <b>yang</b>
yong
```
Even though `Yin yang loooooooooong` is the longest passage, it gets
replaced in the results by two shorter passages, `<b>Yin yang</b>
<b>loooooooooong</b>`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]