author | Christian Urban <urbanc@in.tum.de> |
Fri, 10 Mar 2017 06:22:30 +0000 | |
changeset 120 | 564b4baec85e |
parent 92 | cfff88de2ff5 |
permissions | -rw-r--r-- |
92
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1 |
|
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2 |
import scala.concurrent._ |
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3 |
import scala.concurrent.duration._ |
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4 |
import ExecutionContext.Implicits.global |
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5 |
import scala.language.postfixOps |
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
6 |
|
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
7 |
|
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
8 |
|
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
9 |
lazy val f = Future { |
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
10 |
assert(simp(ZERO | ONE) == ONE) |
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
11 |
assert(simp(STAR(ZERO | ONE)) == STAR(ZERO | ONE)) |
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
12 |
assert(simp(ONE ~ (ONE ~ (ONE ~ CHAR('a')))) == CHAR('a')) |
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
13 |
assert(simp(ONE ~ (ONE ~ (ONE ~ ZERO))) == ZERO) |
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
14 |
assert(simp(ALT(ONE ~ (ONE ~ (ONE ~ ZERO)), CHAR('a'))) == CHAR('a')) |
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
15 |
assert(simp(CHAR('a') | CHAR('a')) == CHAR('a')) |
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
16 |
assert(simp(ONE | CHAR('a')) == (ONE | CHAR('a'))) |
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
17 |
} |
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
18 |
|
cfff88de2ff5
updatd
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
19 |
Await.result(f, 30 second) |