marking/re1b_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(der('a', ZERO | ONE) == (ZERO | ZERO))
       
    11   assert(der('a', (CHAR('a') | ONE) ~ CHAR('a')) == ALT((ONE | ZERO) ~ CHAR('a'), ONE))
       
    12   assert(der('a', STAR(CHAR('a'))) == (ONE ~ STAR(CHAR('a'))))
       
    13   assert(der('b', STAR(CHAR('a'))) == (ZERO ~ STAR(CHAR('a'))))
       
    14 }
       
    15 
       
    16 Await.result(f, 120 second)