347
|
1 |
import CW8c._
|
153
|
2 |
|
221
|
3 |
val EVIL_urban = SEQ(STAR(STAR(CHAR('a'))), CHAR('b'))
|
153
|
4 |
|
300
|
5 |
assert(ders(("a" * 5).toList, EVIL_urban) == SEQ(SEQ(STAR(CHAR('a')),STAR(STAR(CHAR('a')))),CHAR('b')))
|
221
|
6 |
assert(ders(List('b'), EVIL_urban) == ONE)
|
300
|
7 |
assert(ders(List('b','b'), EVIL_urban) == ZERO)
|
221
|
8 |
assert(matcher(EVIL_urban, "a" * 5 ++ "b") == true)
|
300
|
9 |
assert(matcher(EVIL_urban, "a" * 50 ++ "b") == true)
|
|
10 |
assert(matcher(EVIL_urban, "a" * 50) == false)
|
221
|
11 |
assert(matcher(EVIL_urban, "b") == true)
|
|
12 |
assert(matcher(EVIL_urban, "bb") == false)
|
|
13 |
assert(matcher("abc", "abc") == true)
|
300
|
14 |
assert(matcher("abc", "ab") == false)
|
221
|
15 |
assert(matcher(("ab" | "a") ~ (ONE | "bc"), "abc") == true)
|
|
16 |
assert(matcher(ONE, "") == true)
|
|
17 |
assert(matcher(ZERO, "") == false)
|
|
18 |
assert(matcher(ONE | CHAR('a'), "") == true)
|
|
19 |
assert(matcher(ONE | CHAR('a'), "a") == true)
|