diff --git a/csp/src/main/java/com/booleworks/logicng/csp/CspFactory.java b/csp/src/main/java/com/booleworks/logicng/csp/CspFactory.java index 221be911..79ed9727 100644 --- a/csp/src/main/java/com/booleworks/logicng/csp/CspFactory.java +++ b/csp/src/main/java/com/booleworks/logicng/csp/CspFactory.java @@ -917,9 +917,11 @@ public CspAssignment decode(final Assignment model, final Collection *
  • Infix Example: {@code a < b}
  • *
  • Prefix Example: {@code LE[a, b]}
  • + * * @param input input string * @return the parsed predicate * @throws ParserException if parsing is not successful diff --git a/csp/src/test/java/com/booleworks/logicng/csp/terms/IntegerVariableTest.java b/csp/src/test/java/com/booleworks/logicng/csp/terms/IntegerVariableTest.java index aa211637..1852155f 100644 --- a/csp/src/test/java/com/booleworks/logicng/csp/terms/IntegerVariableTest.java +++ b/csp/src/test/java/com/booleworks/logicng/csp/terms/IntegerVariableTest.java @@ -1,8 +1,5 @@ package com.booleworks.logicng.csp.terms; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; - import com.booleworks.logicng.csp.CspFactory; import com.booleworks.logicng.csp.ParameterizedCspTest; import org.junit.jupiter.params.ParameterizedTest; @@ -10,6 +7,9 @@ import java.util.Set; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + public class IntegerVariableTest extends ParameterizedCspTest { @ParameterizedTest @MethodSource("cspFactories") @@ -36,7 +36,8 @@ public void testCreation(final CspFactory cf) { assertThat(c.getDomain().isContiguous()).isTrue(); assertThat(c.getDomain().isEmpty()).isFalse(); - assertThatThrownBy(() -> cf.variable("a", 0, 10)).isInstanceOf(IllegalArgumentException.class); + assertThat(cf.variable("a", 0, 10)).isEqualTo(a); + assertThatThrownBy(() -> cf.variable("a", 0, 2)).isInstanceOf(IllegalArgumentException.class); } @ParameterizedTest