diff options
author | Jean-Remi Desjardins <jeanremi.desjardins@gmail.com> | 2012-12-04 00:37:34 -0500 |
---|---|---|
committer | Jean-Remi Desjardins <jeanremi.desjardins@gmail.com> | 2012-12-04 00:37:34 -0500 |
commit | 2aa66bec86fd464712b0d15251cc400ff9d52821 (patch) | |
tree | d9e330c185158d69d6ed925b60ddec916c3cd3be /test | |
parent | 0b92073a38f9d1823f051ac18173078bfcfafc8a (diff) | |
download | scala-2aa66bec86fd464712b0d15251cc400ff9d52821.tar.gz scala-2aa66bec86fd464712b0d15251cc400ff9d52821.tar.bz2 scala-2aa66bec86fd464712b0d15251cc400ff9d52821.zip |
SI-4664 [Make scala.util.Random Serializable] Add test case
Diffstat (limited to 'test')
-rw-r--r-- | test/files/jvm/serialization.scala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/files/jvm/serialization.scala b/test/files/jvm/serialization.scala index 34b64938b4..f2c47aad77 100644 --- a/test/files/jvm/serialization.scala +++ b/test/files/jvm/serialization.scala @@ -604,6 +604,7 @@ object Test { Test7 Test8 Test9_parallel + Test10_util } } @@ -669,3 +670,17 @@ object Test9_parallel { throw e } } + +//############################################################################ +// Test classes in package scala.util + +object Test10_util { + import scala.util.Random + def rep[A](n: Int)(f: => A) { if (n > 0) { f; rep(n-1)(f) } } + + try { + val random = new Random(345) + val random2: Random = read(write(random)) + rep(5) { assert(random.nextInt == random2.nextInt) } + } +} |