marking/re1c_test.scala
author Christian Urban <urbanc@in.tum.de>
Fri, 10 Mar 2017 06:22:30 +0000
changeset 120 564b4baec85e
parent 92 cfff88de2ff5
permissions -rw-r--r--
updated
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(simp(ZERO | ONE) == ONE)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    11
  assert(simp(STAR(ZERO | ONE)) == STAR(ZERO | ONE))
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    12
  assert(simp(ONE ~ (ONE ~ (ONE ~ CHAR('a')))) == CHAR('a'))
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    13
  assert(simp(ONE ~ (ONE ~ (ONE ~ ZERO))) == ZERO)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    14
  assert(simp(ALT(ONE ~ (ONE ~ (ONE ~ ZERO)), CHAR('a'))) == CHAR('a'))
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    15
  assert(simp(CHAR('a') | CHAR('a')) == CHAR('a'))
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    16
  assert(simp(ONE | CHAR('a')) == (ONE | CHAR('a')))
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    17
}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    18
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    19
Await.result(f, 30 second)