]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Effects1.scl
Automatic execution of SCL tests in Maven
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / Effects1.scl
diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Effects1.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Effects1.scl
new file mode 100644 (file)
index 0000000..11a3303
--- /dev/null
@@ -0,0 +1,18 @@
+import "JavaBuiltin" as Java\r
+\r
+importJava "java.util.regex.Pattern" where\r
+    data Pattern\r
+\r
+    compile :: String -> Pattern\r
+    matcher :: Pattern -> String -> <Proc> Matcher\r
+\r
+importJava "java.util.regex.Matcher" where\r
+    data Matcher\r
+\r
+    matches :: Matcher -> <Proc> Boolean\r
+\r
+doMatch pattern text = matches (matcher pattern text)\r
+\r
+main = doMatch (compile ".*xxx.*") "fffxxooxxxlll"\r
+--\r
+true
\ No newline at end of file