testing4/re_test3.scala
author Christian Urban <urbanc@in.tum.de>
Thu, 29 Nov 2018 17:15:11 +0000
changeset 221 9e7897f25e13
parent 215 testing4/re1c_test.scala@438459a8e48b
child 300 72688efdf17c
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
     4
assert(simp(ZERO | ONE) == ONE)
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
     5
assert(simp(STAR(ZERO | ONE)) == STAR(ZERO | ONE))
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
     6
assert(simp(ONE ~ (ONE ~ (ONE ~ CHAR('a')))) == CHAR('a'))
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
     7
assert(simp(ONE ~ (ONE ~ (ONE ~ ZERO))) == ZERO)
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
     8
assert(simp(ALT(ONE ~ (ONE ~ (ONE ~ ZERO)), CHAR('a'))) == CHAR('a'))
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
     9
assert(simp(CHAR('a') | CHAR('a')) == CHAR('a'))
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    10
assert(simp(ONE | CHAR('a')) == (ONE | CHAR('a')))
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    11
assert(simp(ALT((CHAR('a') | ZERO) ~ ONE,
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    12
               ((ONE | CHAR('b')) | CHAR('c')) ~ (CHAR('d') ~ ZERO))) == CHAR('a'))
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13