diff options
author | James Iry <jamesiry@gmail.com> | 2013-03-20 16:02:32 -0700 |
---|---|---|
committer | James Iry <jamesiry@gmail.com> | 2013-03-20 16:02:32 -0700 |
commit | 89a031802748efda5abc3de9fc01b502f57f9b77 (patch) | |
tree | 931cd0a243b975aee2993f67353cfa540eb36e1b /test/files/run/bitsets.scala | |
parent | fcfe5384d2003673f9f35b92fc256d48acc9d5a3 (diff) | |
parent | 38a1515e8e321a93530a7c963ac3c10bdab0456e (diff) | |
download | scala-89a031802748efda5abc3de9fc01b502f57f9b77.tar.gz scala-89a031802748efda5abc3de9fc01b502f57f9b77.tar.bz2 scala-89a031802748efda5abc3de9fc01b502f57f9b77.zip |
Merge pull request #2235 from vigdorchik/si_5513
SI-5513: add inplace set-theoretic operations for mutable bitsets.
Diffstat (limited to 'test/files/run/bitsets.scala')
-rw-r--r-- | test/files/run/bitsets.scala | 22 |
1 files changed, 22 insertions, 0 deletions
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 } |