diff options
author | Eugene Vigdorchik <eugene.vigdorchik@gmail.com> | 2013-03-11 15:43:29 +0400 |
---|---|---|
committer | Eugene Vigdorchik <eugene.vigdorchik@gmail.com> | 2013-03-11 15:43:29 +0400 |
commit | 38a1515e8e321a93530a7c963ac3c10bdab0456e (patch) | |
tree | cde6a66574f1b039374bb5262b5567e323983dc6 /test/files/run | |
parent | 5483861d2e37e3045c7f4966d51f9fb27ef020dd (diff) | |
download | scala-38a1515e8e321a93530a7c963ac3c10bdab0456e.tar.gz scala-38a1515e8e321a93530a7c963ac3c10bdab0456e.tar.bz2 scala-38a1515e8e321a93530a7c963ac3c10bdab0456e.zip |
SI-5513: add inplace set-theoretic operations for mutable bitsets.
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/bitsets.check | 5 | ||||
-rw-r--r-- | test/files/run/bitsets.scala | 22 |
2 files changed, 27 insertions, 0 deletions
diff --git a/test/files/run/bitsets.check b/test/files/run/bitsets.check index 3f01d2a400..41c2ccdcb8 100644 --- a/test/files/run/bitsets.check +++ b/test/files/run/bitsets.check @@ -37,6 +37,11 @@ m2_r1 = true m2_r2 = true m2_r3 = true +b1:BitSet(5, 6, 7) +b2:BitSet(5) +b3:BitSet(5, 7) +b4:BitSet(7) +b0:BitSet(5, 6, 7) is0 = BitSet() is1 = BitSet() is2 = BitSet(2) diff --git a/test/files/run/bitsets.scala b/test/files/run/bitsets.scala index bdeb1fd811..0ea43fcb95 100644 --- a/test/files/run/bitsets.scala +++ b/test/files/run/bitsets.scala @@ -81,6 +81,27 @@ object TestMutable2 { println } +object TestMutable3 { + import scala.collection.mutable.BitSet + + val b0 = BitSet(5, 6) + val b1 = BitSet(7) + val b2 = BitSet(1, 5) + val b3 = BitSet(6, 7) + val b4 = BitSet(6, 7) + + b1 |= b0 + println(s"b1:$b1") + b2 &= b0 + println(s"b2:$b2") + b3 ^= b0 + println(s"b3:$b3") + b4 &~= b0 + println(s"b4:$b4") + b0 ^= b0 |= b1 + println(s"b0:$b0") +} + object TestImmutable { import scala.collection.immutable.BitSet @@ -155,6 +176,7 @@ object TestImmutable2 { object Test extends App { TestMutable TestMutable2 + TestMutable3 TestImmutable TestImmutable2 } |