marking/re1c_test.scala
changeset 281 87b9e3e2c1a7
parent 280 a057dc4457fc
child 282 ec9773fe1dc0
equal deleted inserted replaced
280:a057dc4457fc 281:87b9e3e2c1a7
     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)