marking/re1c_test.scala
changeset 92 cfff88de2ff5
equal deleted inserted replaced
91:b43c81c65341 92:cfff88de2ff5
       
     1 
       
     2 import scala.concurrent._
       
     3 import scala.concurrent.duration._
       
     4 import ExecutionContext.Implicits.global
       
     5 import scala.language.postfixOps 
       
     6 
       
     7 
       
     8 
       
     9 lazy val f = Future {
       
    10   assert(simp(ZERO | ONE) == ONE)
       
    11   assert(simp(STAR(ZERO | ONE)) == STAR(ZERO | ONE))
       
    12   assert(simp(ONE ~ (ONE ~ (ONE ~ CHAR('a')))) == CHAR('a'))
       
    13   assert(simp(ONE ~ (ONE ~ (ONE ~ ZERO))) == ZERO)
       
    14   assert(simp(ALT(ONE ~ (ONE ~ (ONE ~ ZERO)), CHAR('a'))) == CHAR('a'))
       
    15   assert(simp(CHAR('a') | CHAR('a')) == CHAR('a'))
       
    16   assert(simp(ONE | CHAR('a')) == (ONE | CHAR('a')))
       
    17 }
       
    18 
       
    19 Await.result(f, 30 second)