Skip to content

Commit 87a6902

Browse files
committed
Add test and fix previous tests
1 parent 30dcf88 commit 87a6902

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

test/test_gradedarray.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ using GradedArrays:
2222
using SparseArraysBase: storedlength
2323
using LinearAlgebra: adjoint
2424
using Random: randn!
25-
using Test: @test, @testset
25+
using Test: @test, @testset, @test_throws
2626

2727
function randn_blockdiagonal(elt::Type, axes::Tuple)
2828
a = BlockSparseArray{elt}(undef, axes)
@@ -387,12 +387,10 @@ const elts = (Float32, Float64, Complex{Float32}, Complex{Float64})
387387
a2[Block(2, 1)] = randn(elt, size(@view(a2[Block(2, 1)])))
388388
@test Array(a1 * a2) Array(a1) * Array(a2)
389389
@test Array(a1' * a2') Array(a1') * Array(a2')
390-
391-
a2 = BlockSparseArray{elt}(undef, r, dual(r))
392-
a2[Block(1, 2)] = randn(elt, size(@view(a2[Block(1, 2)])))
393-
a2[Block(2, 1)] = randn(elt, size(@view(a2[Block(2, 1)])))
394390
@test Array(a1' * a2) Array(a1') * Array(a2)
395391
@test Array(a1 * a2') Array(a1) * Array(a2')
392+
393+
@test_throws DimensionMismatch a1 * permutedims(a2, (2, 1))
396394
end
397395
@testset "Construct from dense" begin
398396
r = gradedrange([U1(0) => 2, U1(1) => 3])

0 commit comments

Comments
 (0)