marking/re1b_test.scala
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Mon, 05 Aug 2019 20:14:06 +0100
changeset 269 86a85865e772
parent 90 d77af4aca939
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
90
d77af4aca939 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     1
d77af4aca939 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     2
import scala.concurrent._
d77af4aca939 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     3
import scala.concurrent.duration._
d77af4aca939 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     4
import ExecutionContext.Implicits.global
d77af4aca939 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     5
import scala.language.postfixOps 
d77af4aca939 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     6
d77af4aca939 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     7
d77af4aca939 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     8
d77af4aca939 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     9
lazy val f = Future {
d77af4aca939 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    10
  assert(der('a', ZERO | ONE) == (ZERO | ZERO))
d77af4aca939 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    11
  assert(der('a', (CHAR('a') | ONE) ~ CHAR('a')) == ALT((ONE | ZERO) ~ CHAR('a'), ONE))
d77af4aca939 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    12
  assert(der('a', STAR(CHAR('a'))) == (ONE ~ STAR(CHAR('a'))))
d77af4aca939 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    13
  assert(der('b', STAR(CHAR('a'))) == (ZERO ~ STAR(CHAR('a'))))
d77af4aca939 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    14
}
d77af4aca939 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    15
d77af4aca939 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    16
Await.result(f, 120 second)