Skip to content

Commit 335aaac

Browse files
committed
fix test result in case of alternative solutions
1 parent 2c900b3 commit 335aaac

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

test/testassignment.jl

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@
151151

152152
@test result.problem isa AssignmentProblem
153153
@test result.cost == 2.0
154+
@test size(result.solution) == (3, 3)
154155
@test result.solution == [
155156
0 0 1
156157
0 1 0
@@ -168,12 +169,11 @@
168169

169170
@test result.problem isa AssignmentProblem
170171
@test result.cost == 2.0
171-
@test result.solution == [
172-
0 0 1 0
173-
0 1 0 0
174-
0 0 0 1
175-
1 0 0 0
176-
]
172+
@test size(result.solution) == (4, 4)
173+
174+
# Problem has alternative solutions.
175+
@test result.solution[1, 3] == 1
176+
@test result.solution[2, 2] == 1
177177
end
178178

179179
@testset "Solve Unbalanced Assignment Problem (3x2)" begin
@@ -187,6 +187,7 @@
187187

188188
@test result.problem isa AssignmentProblem
189189
@test result.cost == 2.0
190+
@test size(result.solution) == (3, 3)
190191
@test result.solution == [
191192
0 0 1
192193
0 1 0
@@ -206,11 +207,12 @@
206207

207208
@test result.problem isa AssignmentProblem
208209
@test result.cost == 2.0
209-
@test result.solution == [
210-
0 0 0 1
211-
0 1 0 0
212-
1 0 0 0
213-
0 0 1 0
214-
]
210+
211+
212+
@test size(result.solution) == (4, 4)
213+
214+
# Problem has alternative solutions.
215+
@test result.solution[2, 2] == 1
216+
@test result.solution[3, 1] == 1
215217
end
216218
end

0 commit comments

Comments
 (0)