diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2015-04-22 17:27:58 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2015-04-22 17:27:58 -0700 |
commit | d030172d7ef807d85391d32c5456b1b97b15a402 (patch) | |
tree | 218279a68a56499e337012f1331378d0341ddf52 /test | |
parent | d7aacbbd49b9524a2eb265fe8aa7634844bf57bb (diff) | |
parent | 302562f86e418630b476852b9ba235e85f98bacb (diff) | |
download | scala-d030172d7ef807d85391d32c5456b1b97b15a402.tar.gz scala-d030172d7ef807d85391d32c5456b1b97b15a402.tar.bz2 scala-d030172d7ef807d85391d32c5456b1b97b15a402.zip |
Merge pull request #4415 from Ichoran/issue/9254
SI-9254 UnrolledBuffer appends in wrong position
Diffstat (limited to 'test')
-rw-r--r-- | test/junit/scala/collection/mutable/UnrolledBufferTest.scala | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/junit/scala/collection/mutable/UnrolledBufferTest.scala b/test/junit/scala/collection/mutable/UnrolledBufferTest.scala new file mode 100644 index 0000000000..8660b6cbc1 --- /dev/null +++ b/test/junit/scala/collection/mutable/UnrolledBufferTest.scala @@ -0,0 +1,25 @@ +package scala.collection.mutable + +import org.junit.runner.RunWith +import org.junit.runners.JUnit4 +import org.junit.Test + +@RunWith(classOf[JUnit4]) +class UnrolledBufferTestTest { + @Test + def test_SI9254_original() { + val b = new UnrolledBuffer[Int]() + (1 to 16).foreach(i => b append i) + b.insert(0,-1) + b append 17 + assert(b sameElements (Seq(-1) ++ (1 to 16) ++ Seq(17))) + } + + @Test + def test_SI9254_additional() { + val b = new UnrolledBuffer[Int]() + (1 to 100).foreach(i => b append i) + b.insert(40, -1) + assert(b sameElements((1 to 40) ++ Seq(-1) ++ (41 to 100))) + } +} |