import scala.concurrent._
import scala.concurrent.duration._
import ExecutionContext.Implicits.global
import scala.language.postfixOps
val EVIL = SEQ(STAR(STAR(CHAR('a'))), CHAR('b'))
lazy val f = Future {
assert(ders(List.fill(5)('a'), EVIL) == SEQ(SEQ(STAR(CHAR('a')),STAR(STAR(CHAR('a')))),CHAR('b')))
assert(ders(List('b'), EVIL) == ONE)
assert(ders(List('b','b'), EVIL) == ZERO)
assert(matcher(EVIL, "a" * 5 ++ "b") == true)
assert(matcher(EVIL, "b") == true)
assert(matcher(EVIL, "bb") == false)
assert(matcher("abc", "abc") == true)
assert(matcher(("ab" | "a") ~ (ONE | "bc"), "abc") == true)
assert(matcher(ONE, "") == true)
assert(matcher(ZERO, "") == false)
assert(matcher(ONE | CHAR('a'), "") == true)
assert(matcher(ONE | CHAR('a'), "a") == true)
}
Await.result(f, 90 second)