BaurzhanSakhariev commented on a change in pull request #770:
URL: https://github.com/apache/lucene/pull/770#discussion_r837310904



##########
File path: lucene/core/src/test/org/apache/lucene/util/TestPriorityQueue.java
##########
@@ -163,6 +163,43 @@ public void testInsertWithOverflow() {
     assertEquals((Integer) 2, pq.top());
   }
 
+  public void testAddAllToEmptyQueue() {
+    int size = 10;
+    List<Integer> list = new ArrayList<>();
+    for (int i = 0; i < size; i++) {
+      list.add(random().nextInt());
+    }
+    IntegerQueue pq = new IntegerQueue(size);
+    pq.addAll(list);
+    pq.checkValidity();
+  }
+
+  public void testAddAllToPartiallyFilledQueue() {
+    IntegerQueue pq = new IntegerQueue(20);
+    List<Integer> list = new ArrayList<>();
+    for (int i = 0; i < 10; i++) {
+      list.add(random().nextInt());
+      pq.add(random().nextInt());
+    }
+    pq.addAll(list);
+    pq.checkValidity();

Review comment:
       done. I also kept internal array comparison with jdkQueue - if it's 
comparable probably good to have extra reassurance?




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

Reply via email to