marking/re1e_test.scala
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--
updatd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
92
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     2
import scala.concurrent._
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     3
import scala.concurrent.duration._
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     4
import ExecutionContext.Implicits.global
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     5
import scala.language.postfixOps 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     6
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     7
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     8
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     9
lazy val f = Future {
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    10
  assert(replace("aa".% | "bb", "aabbbaaaaaaabaaaaabbaaaabb" , "c") == "ccbcabcaccc")
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    11
  assert(replace("aa".% | "bb", "abba" , "") == "aa")
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    12
}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    13
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    14
Await.result(f, 120 second)