author | Christian Urban <urbanc@in.tum.de> |
Fri, 07 Dec 2018 07:57:54 +0000 | |
changeset 240 | b8cdaf51ffef |
parent 90 | d77af4aca939 |
permissions | -rw-r--r-- |
90
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1 |
|
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2 |
import scala.concurrent._ |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3 |
import scala.concurrent.duration._ |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4 |
import ExecutionContext.Implicits.global |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5 |
import scala.language.postfixOps |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
6 |
|
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
7 |
|
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
8 |
|
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
9 |
lazy val f = Future { |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
10 |
assert(der('a', ZERO | ONE) == (ZERO | ZERO)) |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
11 |
assert(der('a', (CHAR('a') | ONE) ~ CHAR('a')) == ALT((ONE | ZERO) ~ CHAR('a'), ONE)) |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
12 |
assert(der('a', STAR(CHAR('a'))) == (ONE ~ STAR(CHAR('a')))) |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
13 |
assert(der('b', STAR(CHAR('a'))) == (ZERO ~ STAR(CHAR('a')))) |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
14 |
} |
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
15 |
|
d77af4aca939
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
16 |
Await.result(f, 120 second) |