You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/12/02 11:38:40 UTC

[GitHub] [lucene] rmuir commented on a change in pull request #503: LUCENE-10279: Fix equals in MultiRangeQuery

rmuir commented on a change in pull request #503:
URL: https://github.com/apache/lucene/pull/503#discussion_r761010365



##########
File path: lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestMultiRangeQueries.java
##########
@@ -649,4 +649,109 @@ public void testToString() {
         "point:{[111 TO 117],[294 TO 301],[502 TO 514]},{[15 TO 200],[412 TO 567],[415 TO 642]}",
         query.toString());
   }
+
+  public void testEqualsAndHashCode() {
+    {
+      double[] firstDoubleLowerRange = {111, 294.3, 502.4};
+      double[] firstDoubleUpperRange = {117.3, 301.8, 514.3};
+
+      double[] secondDoubleLowerRange = {15.3, 412.8, 415.1};
+      double[] secondDoubleUpperRange = {200.4, 567.4, 642.2};
+
+      DoublePointMultiRangeBuilder doublePointBuilder1 =
+          new DoublePointMultiRangeBuilder("point", 3);
+
+      doublePointBuilder1.add(firstDoubleLowerRange, firstDoubleUpperRange);
+      doublePointBuilder1.add(secondDoubleLowerRange, secondDoubleUpperRange);
+
+      Query query1 = doublePointBuilder1.build();

Review comment:
       Should we toss in a `QueryUtils.check(query1)` ? It is just a helper method, useful in equals/hashcode tests that checks some corner cases such as `equals(null)` and `equals(otherClass)` behave correctly.




-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org