You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "uschindler (via GitHub)" <gi...@apache.org> on 2023/02/06 23:07:08 UTC

[GitHub] [lucene] uschindler opened a new pull request, #12134: Add tests for size() and contains() to LongHashSet

uschindler opened a new pull request, #12134:
URL: https://github.com/apache/lucene/pull/12134

   Another followup for #12128: Due to previously only testing the `java.util.Set` interface, the actual testing code never verified that `size()` and the actual call to `contains(long)` worked 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


[GitHub] [lucene] uschindler commented on pull request #12134: Add tests for size() and contains() to LongHashSet

Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler commented on PR #12134:
URL: https://github.com/apache/lucene/pull/12134#issuecomment-1419949170

   Fixed. Actually code is better readable now.


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


[GitHub] [lucene] uschindler merged pull request #12134: Add tests for size() and contains() to LongHashSet

Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler merged PR #12134:
URL: https://github.com/apache/lucene/pull/12134


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


[GitHub] [lucene] uschindler commented on pull request #12134: Add tests for size() and contains() to LongHashSet

Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler commented on PR #12134:
URL: https://github.com/apache/lucene/pull/12134#issuecomment-1419932992

   I found a bug, first test works, second one does not work:
   
   ```java
     public void testSameValue() {
       LongHashSet set2 = new LongHashSet(new long[] {42L, 42L});
       assertEquals(1, set2.size());
       assertEquals(42L, set2.minValue);
       assertEquals(42L, set2.maxValue);
     }
   
     public void testSameMissingPlaceholder() {
       LongHashSet set2 = new LongHashSet(new long[] {Long.MIN_VALUE, Long.MIN_VALUE});
       assertEquals(1, set2.size());
       assertEquals(Long.MIN_VALUE, set2.minValue);
       assertEquals(Long.MIN_VALUE, set2.maxValue);
     }
   ```
   
   The problem is that `MISSING` is counted twice, because it is not added to the hashtable and handled separately in ctor. The fix is easy...
   
   Will commit a fix, too.


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