testing4/re_test4.scala
author Christian Urban <urbanc@in.tum.de>
Thu, 29 Nov 2018 17:15:11 +0000
changeset 221 9e7897f25e13
parent 215 testing4/re1d_test.scala@438459a8e48b
child 300 72688efdf17c
permissions -rw-r--r--
updated


val EVIL_urban = SEQ(STAR(STAR(CHAR('a'))), CHAR('b'))

//println("1")
assert(ders("aaaaa".toList, EVIL_urban) == SEQ(SEQ(STAR(CHAR('a')),STAR(STAR(CHAR('a')))),CHAR('b')))
//println("2")
assert(ders(List('b'), EVIL_urban) == ONE)
//println("3")
assert(ders("bb".toList, EVIL_urban) == ZERO)
//println("4")
assert(matcher(EVIL_urban, "a" * 5 ++ "b") == true)
//println("5")
assert(matcher(EVIL_urban, "b") == true)
//println("6") 
assert(matcher(EVIL_urban, "bb") == false)
//println("7")
assert(matcher("abc", "abc") == true)
//println("8")
assert(matcher(("ab" | "a") ~ (ONE | "bc"), "abc") == true)
//println("9")
assert(matcher(ONE, "") == true)
//println("10")
assert(matcher(ZERO, "") == false)
//println("11")
assert(matcher(ONE | CHAR('a'), "") == true)
//println("12")
assert(matcher(ONE | CHAR('a'), "a") == true)