diff --git a/Tests/UIntTests.cs b/Tests/UIntTests.cs index 0bbffbc..13e3bfc 100644 --- a/Tests/UIntTests.cs +++ b/Tests/UIntTests.cs @@ -97,6 +97,24 @@ public void UIntGreaterEqual() } } + [TestMethod] + public void ConversionFromLinExpr() + { + var m = new Model(); + + var J0 = m.AddUIntVar(7); + var J1 = m.AddUIntVar(7); + + m.AddConstr(J0 == 7); + + m.AddConstr(J1 == ((J0 + 1).ToUInt(m) & 0x7)); + m.Solve(); + + Assert.AreEqual(State.Satisfiable, m.State); + Assert.AreEqual(7, J0.X); + Assert.AreEqual(0, J1.X); + } + [TestMethod] public void UIntAddBool() {