X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=tests%2Forg.simantics.scl.compiler.tests%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Ftests%2Fscl%2FCHR11.scl;fp=tests%2Forg.simantics.scl.compiler.tests%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Ftests%2Fscl%2FCHR11.scl;h=3ba991ef5fa5fd72e392ab89b5cfd22c0588a213;hb=1ed310d4abb7444048b899f27822ec29a0d35e94;hp=0000000000000000000000000000000000000000;hpb=0d50e7ddf3d00d7ceabf109848139531dafffd6a;p=simantics%2Fplatform.git 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 index 000000000..3ba991ef5 --- /dev/null +++ b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/CHR11.scl @@ -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