summaryrefslogtreecommitdiffstats
path: root/test/jrummikub
diff options
context:
space:
mode:
Diffstat (limited to 'test/jrummikub')
-rw-r--r--test/jrummikub/ai/fdsolver/SolverTest.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/test/jrummikub/ai/fdsolver/SolverTest.java b/test/jrummikub/ai/fdsolver/SolverTest.java
index 535ef57..ae32b07 100644
--- a/test/jrummikub/ai/fdsolver/SolverTest.java
+++ b/test/jrummikub/ai/fdsolver/SolverTest.java
@@ -16,14 +16,12 @@ public class SolverTest {
solver.addConstraint(new LessThan<Integer>(false, y, x));
- int lastx = 0, lasty = 0;
while (solver.solve()) {
- lastx = x.getValue();
- lasty = y.getValue();
+ solver.record();
solver.addConstraint(new LessThanConst<Integer>(false, x, x.getValue()));
}
-
- assertEquals(2, lastx);
- assertEquals(1, lasty);
+ solver.restore();
+ assertEquals(2, (int)x.getValue());
+ assertEquals(1, (int)y.getValue());
}
}