Permalink
Browse files

SI-4664 [Make scala.util.Random Serializable] Add test case

  • Loading branch information...
1 parent 0b92073 commit 2aa66bec86fd464712b0d15251cc400ff9d52821 @jedesah jedesah committed Dec 4, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 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) }
+ }
+}

0 comments on commit 2aa66be

Please sign in to comment.