gsmiller commented on code in PR #1013: URL: https://github.com/apache/lucene/pull/1013#discussion_r948197598
########## lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java: ########## @@ -455,9 +500,9 @@ public void testEmptyRangesMultiValued() throws Exception { Facets facets = new LongRangeFacetCounts("field", fc); - FacetResult result = facets.getAllChildren("field"); - assertEquals("dim=field path=[] value=0 childCount=0\n", result.toString()); - result = facets.getTopChildren(1, "field"); + assertFacetResult( + facets.getAllChildren("field"), "field", new String[0], 0, 0, new LabelAndValue[] {}); Review Comment: minor: `new LabelAndValue[0]`? ########## lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java: ########## @@ -424,9 +469,9 @@ public void testEmptyRangesSingleValued() throws Exception { Facets facets = new LongRangeFacetCounts("field", fc); - FacetResult result = facets.getAllChildren("field"); - assertEquals("dim=field path=[] value=0 childCount=0\n", result.toString()); - result = facets.getTopChildren(1, "field"); + assertFacetResult( + facets.getAllChildren("field"), "field", new String[0], 0, 0, new LabelAndValue[] {}); Review Comment: minor: for consistency here, I'd suggest `new LabelAndValue[0]`? ########## lucene/CHANGES.txt: ########## @@ -52,6 +52,8 @@ Improvements * LUCENE-10614: Properly support getTopChildren in RangeFacetCounts. (Yuting Gan) +* LUCENE-10644: Facets#getAllChildren testing should ignore child order. (Yuting Gan) Review Comment: We don't need to wait for 10.0 to release this do we? Should we try to release this with 9.4? ########## lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java: ########## @@ -100,12 +100,21 @@ public void testBasicLong() throws Exception { new LongRange("90 or above", 90L, true, 100L, false), new LongRange("over 1000", 1000L, false, Long.MAX_VALUE, true)); - FacetResult result = facets.getAllChildren("field"); - assertEquals( - "dim=field path=[] value=22 childCount=5\n less than 10 (10)\n less than or equal to 10 (11)\n over 90 (9)\n 90 or above (10)\n over 1000 (1)\n", - result.toString()); + assertFacetResult( Review Comment: So our implementation (and javadoc) for `RangeFacetCounts#getAllChildren` specifies that we _do_ actually guarantee child ordering. We should probably make sure our tests actually _do_ check ordering for range faceting right? -- 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-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org