testing4/re_test4.scala
changeset 221 9e7897f25e13
parent 215 438459a8e48b
child 300 72688efdf17c
equal deleted inserted replaced
220:3020f8c76baa 221:9e7897f25e13
       
     1 
       
     2 val EVIL_urban = SEQ(STAR(STAR(CHAR('a'))), CHAR('b'))
       
     3 
       
     4 //println("1")
       
     5 assert(ders("aaaaa".toList, EVIL_urban) == SEQ(SEQ(STAR(CHAR('a')),STAR(STAR(CHAR('a')))),CHAR('b')))
       
     6 //println("2")
       
     7 assert(ders(List('b'), EVIL_urban) == ONE)
       
     8 //println("3")
       
     9 assert(ders("bb".toList, EVIL_urban) == ZERO)
       
    10 //println("4")
       
    11 assert(matcher(EVIL_urban, "a" * 5 ++ "b") == true)
       
    12 //println("5")
       
    13 assert(matcher(EVIL_urban, "b") == true)
       
    14 //println("6") 
       
    15 assert(matcher(EVIL_urban, "bb") == false)
       
    16 //println("7")
       
    17 assert(matcher("abc", "abc") == true)
       
    18 //println("8")
       
    19 assert(matcher(("ab" | "a") ~ (ONE | "bc"), "abc") == true)
       
    20 //println("9")
       
    21 assert(matcher(ONE, "") == true)
       
    22 //println("10")
       
    23 assert(matcher(ZERO, "") == false)
       
    24 //println("11")
       
    25 assert(matcher(ONE | CHAR('a'), "") == true)
       
    26 //println("12")
       
    27 assert(matcher(ONE | CHAR('a'), "a") == true)