Class | ConstraintSolver::ConstraintListTest |
In: |
test/ConstraintListTest.rb
|
Parent: | Test::Unit::TestCase |
# File test/ConstraintListTest.rb, line 14 def setup @var1 = Variable.new("test1", Domain.new([ 1 ].to_set), 1) @var2 = Variable.new("test2", Domain.new([ 1 ].to_set), 1) @var3 = Variable.new("test3", Domain.new([ 1 ].to_set)) @proc = Proc.new {|a, b| a == b } @con1 = BinaryConstraint.new(@var1, @var2, @proc) @con2 = BinaryConstraint.new(@var1, @var3, @proc) @cl = ConstraintList.new([ @con1, @con2 ]) end
# File test/ConstraintListTest.rb, line 31 def testAllDifferentConstraintList allDiff = AllDifferentConstraint.new([ @var1, @var2, @var3 ]) list = ConstraintList.new([ allDiff ]) assert_equal(list, list.notAllAssignedWithVariable(@var1)) end