diff options
author | Mark Zitnik <mark.zitnik@gmail.com> | 2015-01-18 18:34:15 +0200 |
---|---|---|
committer | Mark Zitnik <mark.zitnik@gmail.com> | 2015-01-18 18:34:15 +0200 |
commit | fb043761806f8ef2c7a662f15ba5ac5731426dbf (patch) | |
tree | fbda68065784bdffb3595ec6a2c13b4fda1e2775 /test | |
parent | d395e52eb1aad201746d978e31a350756d846614 (diff) | |
download | scala-fb043761806f8ef2c7a662f15ba5ac5731426dbf.tar.gz scala-fb043761806f8ef2c7a662f15ba5ac5731426dbf.tar.bz2 scala-fb043761806f8ef2c7a662f15ba5ac5731426dbf.zip |
SI-9072 Vector ++ concatenation of parallel collection cause inconsistent results
Diffstat (limited to 'test')
-rw-r--r-- | test/junit/scala/collection/immutable/VectorTest.scala | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/junit/scala/collection/immutable/VectorTest.scala b/test/junit/scala/collection/immutable/VectorTest.scala new file mode 100644 index 0000000000..e7edba3e43 --- /dev/null +++ b/test/junit/scala/collection/immutable/VectorTest.scala @@ -0,0 +1,20 @@ +package scala.collection.immutable + +import org.junit.{Assert, Test} +import org.junit.runner.RunWith +import org.junit.runners.JUnit4 + +@RunWith(classOf[JUnit4]) +class VectorTest { + /** + * Test Vector ++ with a small parallel collection concatenation (SI-9072). + * + */ + @Test + def testPlusPlus(): Unit = { + val smallVec = (0 to 1) + val smallParVec = smallVec.par + val testElementsSize = (0 to 1000).map( _ => Vector.empty ++ smallParVec ) + Assert.assertTrue(testElementsSize.forall( v => v.size == 2 )) + } +} |