author | Christian Urban <christian dot urban at kcl dot ac dot uk> |
Tue, 20 Dec 2016 01:48:09 +0000 | |
changeset 92 | cfff88de2ff5 |
permissions | -rw-r--r-- |
92
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1 |
|
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2 |
import scala.concurrent._ |
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3 |
import scala.concurrent.duration._ |
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4 |
import ExecutionContext.Implicits.global |
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5 |
import scala.language.postfixOps |
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
6 |
|
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
7 |
|
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
8 |
|
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
9 |
lazy val f = Future { |
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
10 |
assert(replace("aa".% | "bb", "aabbbaaaaaaabaaaaabbaaaabb" , "c") == "ccbcabcaccc") |
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
11 |
assert(replace("aa".% | "bb", "abba" , "") == "aa") |
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
12 |
} |
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
13 |
|
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
14 |
Await.result(f, 120 second) |