]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/CHR11.scl
(refs #7365) Unit test for the bug
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / CHR11.scl
diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/CHR11.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/CHR11.scl
new file mode 100644 (file)
index 0000000..3ba991e
--- /dev/null
@@ -0,0 +1,26 @@
+module { export = [main], features = [chr] }
+import "Prelude"
+
+ruleset Foo where
+    constraint Foo Integer
+
+main = ()
+  where
+    foo = createFoo
+    include Foo foo
+    
+    when Foo ?x
+    then print ?x
+    
+    when True
+    then Foo 2
+    
+    when Foo ?x
+         ?x < 5
+    then Foo (?x + 1)
+--
+2
+3
+4
+5
+()
\ No newline at end of file