main_testing3/re_test7.scala
changeset 475 59e005dcf163
parent 433 6af86ba1208f
--- a/main_testing3/re_test7.scala	Thu Nov 02 13:53:37 2023 +0000
+++ b/main_testing3/re_test7.scala	Thu Nov 02 23:34:53 2023 +0000
@@ -1,19 +1,22 @@
-import M3._
 
-val EVIL_urban = SEQ(STAR(STAR(CHAR('a'))), CHAR('b'))
+def urbanmain() = {
+  import M3._
+
+  val EVIL_urban = SEQ(STAR(STAR(CHAR('a'))), CHAR('b'))
 
-assert(ders(("a" * 5).toList, EVIL_urban) == SEQs(List(STAR(CHAR('a')), STAR(STAR(CHAR('a'))), CHAR('b'))))
-assert(ders(List('b'), EVIL_urban) == ONE)
-assert(ders(List('b','b'), EVIL_urban) == ZERO)
-assert(matcher(EVIL_urban, "a" * 5 ++ "b") == true)
-assert(matcher(EVIL_urban, "a" * 50 ++ "b") == true)
-assert(matcher(EVIL_urban, "a" * 50) == false)
-assert(matcher(EVIL_urban, "b") == true)
-assert(matcher(EVIL_urban, "bb") == false)
-assert(matcher("abc", "abc") == true)
-assert(matcher("abc", "ab") == false)
-assert(matcher(("ab" | "a") ~ (ONE | "bc"), "abc") == true)
-assert(matcher(ONE, "") == true)
-assert(matcher(ZERO, "") == false)
-assert(matcher(ONE | CHAR('a'), "") == true)
-assert(matcher(ONE | CHAR('a'), "a") == true)
+  assert(ders(("a" * 5).toList, EVIL_urban) == SEQs(List(STAR(CHAR('a')), STAR(STAR(CHAR('a'))), CHAR('b'))))
+  assert(ders(List('b'), EVIL_urban) == ONE)
+  assert(ders(List('b','b'), EVIL_urban) == ZERO)
+  assert(matcher(EVIL_urban, "a" * 5 ++ "b") == true)
+  assert(matcher(EVIL_urban, "a" * 50 ++ "b") == true)
+  assert(matcher(EVIL_urban, "a" * 50) == false)
+  assert(matcher(EVIL_urban, "b") == true)
+  assert(matcher(EVIL_urban, "bb") == false)
+  assert(matcher("abc", "abc") == true)
+  assert(matcher("abc", "ab") == false)
+  assert(matcher(("ab" | "a") ~ (ONE | "bc"), "abc") == true)
+  assert(matcher(ONE, "") == true)
+  assert(matcher(ZERO, "") == false)
+  assert(matcher(ONE | CHAR('a'), "") == true)
+  assert(matcher(ONE | CHAR('a'), "a") == true)
+}