main_testing3/re_test6.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Mon, 08 Nov 2021 01:39:00 +0000
changeset 403 ffce7b61b446
parent 347 4de31fdc0d67
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
403
ffce7b61b446 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 347
diff changeset
     1
import M3._
300
72688efdf17c updated testing files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
72688efdf17c updated testing files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
val EVIL_urban = SEQ(STAR(STAR(CHAR('a'))), CHAR('b'))
72688efdf17c updated testing files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
72688efdf17c updated testing files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
72688efdf17c updated testing files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
assert(simp(Iterator.iterate(ONE:Rexp)(r => SEQ(r, ONE | ONE)).drop(50).next) == ONE)
72688efdf17c updated testing files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
assert(simp(Iterator.iterate(ONE:Rexp)(r => ALT(r, r)).drop(20).next) == ONE)
72688efdf17c updated testing files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
assert(matcher(EVIL_urban, "a" * 1000000) == false)
72688efdf17c updated testing files
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
assert(matcher(EVIL_urban, "a" * 1000000 ++ "b") == true)