From: Hannu Niemistö Date: Thu, 13 Jul 2017 11:56:46 +0000 (+0300) Subject: (refs #7365) Unit test for the bug X-Git-Tag: v1.31.0~264^2~53 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F15%2F715%2F1;p=simantics%2Fplatform.git (refs #7365) Unit test for the bug "CHR constraint from an included ruleset is activated multiple times" Change-Id: If24b6b3251ad563ccc8f9db9c97c71279f688325 --- diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ActiveTests.java b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ActiveTests.java index c4d1c6f23..4b9a3ffd2 100644 --- a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ActiveTests.java +++ b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ActiveTests.java @@ -19,4 +19,6 @@ public class ActiveTests extends TestBase { */ //@Test public void Bug6989() { test(); } + + @Test public void CHR11() { test(); } } 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