]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Transformation5.scl
Automatic execution of SCL tests in Maven
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / Transformation5.scl
diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Transformation5.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Transformation5.scl
new file mode 100644 (file)
index 0000000..e041430
--- /dev/null
@@ -0,0 +1,22 @@
+import "StandardLibrary"
+
+Foo ?x :-
+    @enforce 1
+    Execute (?x := (1 :: Integer))
+
+Bar ?x :-
+    @enforce 2
+    Execute (if getRef ?x == 1 then () else fail "Test failed.")
+    
+rule DoIt where
+    @from
+    ?x = ref (0 :: Integer)
+    
+    @to
+    Bar ?x
+    Foo ?x
+
+main :: ()
+main = transformation OneShotForward where
+--
+()