Skip to content

Commit fc670f5

Browse files
committed
Add some more matrix comparison tests
1 parent ca1d26a commit fc670f5

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

test/generic/Matrix-test.jl

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,27 @@ end
308308
@test D4[5, 5] == R(5)
309309
@test D4 isa Generic.MatSpaceElem{elem_type(R)}
310310

311+
# test comparison of matrices over different ring, and of different sizes
311312
x = zero_matrix(R, 2, 2)
312313
y = zero_matrix(ZZ, 2, 3)
313314

315+
@test x != y
314316
@test x in [x, y]
315317
@test x in [y, x]
316318
@test !(x in [y])
317-
319+
320+
@test x in keys(Dict(x => 1))
321+
@test !(y in keys(Dict(x => 1)))
322+
323+
# test comparison of matrices over same ring, but of different sizes
324+
x = zero_matrix(ZZ, 2, 2)
325+
y = zero_matrix(ZZ, 2, 3)
326+
327+
@test x != y
328+
@test x in [x, y]
329+
@test x in [y, x]
330+
@test !(x in [y])
331+
318332
@test x in keys(Dict(x => 1))
319333
@test !(y in keys(Dict(x => 1)))
320334

0 commit comments

Comments
 (0)