changeset 281 | 87b9e3e2c1a7 |
parent 280 | a057dc4457fc |
child 282 | ec9773fe1dc0 |
280:a057dc4457fc | 281:87b9e3e2c1a7 |
---|---|
1 import scala.concurrent._ |
|
2 import scala.concurrent.duration._ |
|
3 import ExecutionContext.Implicits.global |
|
4 import scala.language.postfixOps |
|
5 |
|
6 |
|
7 |
|
8 lazy val f = Future { |
|
9 assert(iterT(200000, (x: Int) => x + 1, 0) == 200000) |
|
10 assert(iterT(100, (x: BigInt) => x * 2, BigInt(2)) == BigInt("2535301200456458802993406410752")) |
|
11 assert(iterT(10, (x: String) => x ++ "a", "a") == "aaaaaaaaaaa") |
|
12 } |
|
13 |
|
14 Await.result(f, 90 second) |