Skip to content

Commit 91af9a6

Browse files
authored
[Bridges] improve code coverage (#1930)
1 parent a99668c commit 91af9a6

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

test/Bridges/Constraint/bin_packing.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,16 @@ function test_runtests_VectorOfVariables()
2626
MOI.Bridges.runtests(
2727
MOI.Bridges.Constraint.BinPackingToMILPBridge,
2828
"""
29-
variables: x, y, z
29+
variables: a, x, y, z
3030
[x, y, z] in BinPacking(3.0, [1.1, 1.9, 2.8])
3131
x in Interval(1.0, 3.0)
3232
y >= 2.0
3333
y <= 3.0
3434
z == 3.0
35+
a in ZeroOne()
3536
""",
3637
"""
37-
variables: x, y, z, x1, x2, x3, y2, y3, z3
38+
variables: a, x, y, z, x1, x2, x3, y2, y3, z3
3839
1.1 * x1 <= 3.0
3940
1.1 * x2 + 1.9 * y2 <= 3.0
4041
1.1 * x3 + 1.9 * y3 + 2.8 * z3 <= 3.0
@@ -54,6 +55,7 @@ function test_runtests_VectorOfVariables()
5455
y >= 2.0
5556
y <= 3.0
5657
z == 3.0
58+
a in ZeroOne()
5759
""",
5860
)
5961
return

test/Bridges/Constraint/count_belongs.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ function test_runtests_VectorOfVariables()
2626
MOI.Bridges.runtests(
2727
MOI.Bridges.Constraint.CountBelongsToMILPBridge,
2828
"""
29-
variables: n, x, y
29+
variables: a, n, x, y
3030
[n, x, y] in CountBelongs(3, Set([2, 4]))
3131
x in Interval(1.0, 2.0)
3232
y >= 2.0
3333
y <= 3.0
34+
a in ZeroOne()
3435
""",
3536
"""
36-
variables: n, x, y, z_x1, z_x2, z_y2, z_y3
37+
variables: a, n, x, y, z_x1, z_x2, z_y2, z_y3
3738
1.0 * x + -1.0 * z_x1 + -2.0 * z_x2 == 0.0
3839
1.0 * y + -2.0 * z_y2 + -3.0 * z_y3 == 0.0
3940
z_x1 + z_x2 == 1.0
@@ -46,6 +47,7 @@ function test_runtests_VectorOfVariables()
4647
z_x2 in ZeroOne()
4748
z_y2 in ZeroOne()
4849
z_y3 in ZeroOne()
50+
a in ZeroOne()
4951
""",
5052
)
5153
return

test/Bridges/Constraint/count_distinct.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ function test_runtests_VectorOfVariables()
2626
MOI.Bridges.runtests(
2727
MOI.Bridges.Constraint.CountDistinctToMILPBridge,
2828
"""
29-
variables: n, x, y
29+
variables: a, n, x, y
3030
[n, x, y] in CountDistinct(3)
3131
x in Interval(1.0, 2.0)
3232
y >= 2.0
3333
y <= 3.0
34+
a in ZeroOne()
3435
""",
3536
"""
36-
variables: n, x, y, z_x1, z_x2, z_y2, z_y3, a_1, a_2, a_3
37+
variables: a, n, x, y, z_x1, z_x2, z_y2, z_y3, a_1, a_2, a_3
3738
1.0 * x + -1.0 * z_x1 + -2.0 * z_x2 == 0.0
3839
1.0 * y + -2.0 * z_y2 + -3.0 * z_y3 == 0.0
3940
-1.0 * n + a_1 + a_2 + a_3 == 0.0
@@ -55,6 +56,7 @@ function test_runtests_VectorOfVariables()
5556
a_1 in ZeroOne()
5657
a_2 in ZeroOne()
5758
a_3 in ZeroOne()
59+
a in ZeroOne()
5860
""",
5961
)
6062
return

0 commit comments

Comments
 (0)