testing3/re1c_test.scala
author Christian Urban <urbanc@in.tum.de>
Fri, 23 Feb 2018 22:26:42 +0000
changeset 170 37b1bfcdba79
parent 160 863feeb5c760
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
160
863feeb5c760 updated
Christian Urban <urbanc@in.tum.de>
parents: 153
diff changeset
     2
//import scala.concurrent._
863feeb5c760 updated
Christian Urban <urbanc@in.tum.de>
parents: 153
diff changeset
     3
//import scala.concurrent.duration._
863feeb5c760 updated
Christian Urban <urbanc@in.tum.de>
parents: 153
diff changeset
     4
//import ExecutionContext.Implicits.global
863feeb5c760 updated
Christian Urban <urbanc@in.tum.de>
parents: 153
diff changeset
     5
//import scala.language.postfixOps 
863feeb5c760 updated
Christian Urban <urbanc@in.tum.de>
parents: 153
diff changeset
     6
//import scala.language.reflectiveCalls
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
160
863feeb5c760 updated
Christian Urban <urbanc@in.tum.de>
parents: 153
diff changeset
     9
//lazy val f = Future {
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
  import CW8a._
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
  assert(simp(ZERO | ONE) == ONE)
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
  assert(simp(STAR(ZERO | ONE)) == STAR(ZERO | ONE))
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
  assert(simp(ONE ~ (ONE ~ (ONE ~ CHAR('a')))) == CHAR('a'))
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
  assert(simp(ONE ~ (ONE ~ (ONE ~ ZERO))) == ZERO)
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
  assert(simp(ALT(ONE ~ (ONE ~ (ONE ~ ZERO)), CHAR('a'))) == CHAR('a'))
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
  assert(simp(CHAR('a') | CHAR('a')) == CHAR('a'))
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
  assert(simp(ONE | CHAR('a')) == (ONE | CHAR('a')))
160
863feeb5c760 updated
Christian Urban <urbanc@in.tum.de>
parents: 153
diff changeset
    19
  assert(simp(ALT((CHAR('a') | ZERO) ~ ONE,
863feeb5c760 updated
Christian Urban <urbanc@in.tum.de>
parents: 153
diff changeset
    20
                  ((ONE | CHAR('b')) | CHAR('c')) ~ (CHAR('d') ~ ZERO))) == CHAR('a'))
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
160
863feeb5c760 updated
Christian Urban <urbanc@in.tum.de>
parents: 153
diff changeset
    22
//}
863feeb5c760 updated
Christian Urban <urbanc@in.tum.de>
parents: 153
diff changeset
    23
863feeb5c760 updated
Christian Urban <urbanc@in.tum.de>
parents: 153
diff changeset
    24
//Await.result(f, 30 second)