Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/172#discussion_r10718634
  
    --- Diff: 
core/src/test/scala/org/apache/spark/util/collection/BitSetSuite.scala ---
    @@ -69,4 +69,45 @@ class BitSetSuite extends FunSuite {
         assert(bitset.nextSetBit(96) === 96)
         assert(bitset.nextSetBit(97) === -1)
       }
    +
    +  test( "xor" ) {
    +    val setBitsX = Seq( 0, 2, 3, 37, 41 )
    +    val setBitsY = Seq( 0, 1, 3, 37, 38, 41, 85)
    +    val bitsetX = new BitSet(60)
    +    setBitsX.foreach( i => bitsetX.set(i))
    +    val bitsetY = new BitSet(100)
    +    setBitsY.foreach( i => bitsetY.set(i))
    +
    +    val bitsetXor = bitsetX ^ bitsetY
    +
    +    assert(bitsetXor.nextSetBit(0) === 1)
    +    assert(bitsetXor.nextSetBit(1) === 1)
    +    assert(bitsetXor.nextSetBit(2) === 2)
    +    assert(bitsetXor.nextSetBit(3) === 38)
    +    assert(bitsetXor.nextSetBit(38) === 38)
    +    assert(bitsetXor.nextSetBit(39) === 85)
    +    assert(bitsetXor.nextSetBit(42) === 85)
    +    assert(bitsetXor.nextSetBit(85) === 85)
    +    assert(bitsetXor.nextSetBit(86) === -1)
    +
    +  }
    +
    +  test( "and-not" ) {
    +    val setBitsX = Seq( 0, 2, 3, 37, 41, 48 )
    --- End diff --
    
    here too - make the test case symmetric by covering the other test case


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to