main_marking3/re_test5.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Thu, 08 Dec 2022 17:53:08 +0000
changeset 452 4772b6166720
parent 424 daf561a83ba6
child 463 0315d9983cd0
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
424
Christian Urban <christian.urban@kcl.ac.uk>
parents: 390
diff changeset
     1
import M3._
390
175a950470a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     2
 
175a950470a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     3
val EVIL_urban = SEQ(STAR(STAR(CHAR('a'))), CHAR('b'))
175a950470a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     4
175a950470a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     5
assert(size(der('a', der('a', EVIL_urban))) == 28)
175a950470a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     6
assert(size(der('a', der('a', der('a', EVIL_urban)))) == 58)
175a950470a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     7
175a950470a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     8
assert(size(ders("aaaaaa".toList, EVIL_urban)) == 8)
175a950470a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     9
assert(size(ders(("a" * 50).toList, EVIL_urban)) == 8)