Skip to content

Commit

Permalink
SI-4664 [Make scala.util.Random Serializable] Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
jedesah committed Dec 4, 2012
1 parent 0b92073 commit 2aa66be
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/files/jvm/serialization.scala
Expand Up @@ -604,6 +604,7 @@ object Test {
Test7 Test7
Test8 Test8
Test9_parallel Test9_parallel
Test10_util
} }
} }


Expand Down Expand Up @@ -669,3 +670,17 @@ object Test9_parallel {
throw e 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) }
}
}

0 comments on commit 2aa66be

Please sign in to comment.