Skip to content

Commit 944ac82

Browse files
committed
Add tests
1 parent 5db70d1 commit 944ac82

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "BlockSparseArrays"
22
uuid = "2c9a651f-6452-4ace-a6ac-809f4280fbb4"
33
authors = ["ITensor developers <[email protected]> and contributors"]
4-
version = "0.2.7"
4+
version = "0.2.8"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

examples/README.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ function main()
8787
@test b[Block(1, 2)] == a₁₂
8888

8989
## Matrix multiplication
90-
## TODO: Fix this, broken.
91-
@test_broken b * b Array(b) * Array(b)
90+
@test b * b Array(b) * Array(b)
9291

9392
permuted_b = permutedims(b, (2, 1))
9493
@test permuted_b isa BlockSparseArray

test/basics/test_basics.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ arrayts = (Array, JLArray)
192192
for b in (
193193
(b = copy(a); @allowscalar b[] = 2; b),
194194
(b = copy(a); @allowscalar b[CartesianIndex()] = 2; b),
195+
(b = copy(a); @allowscalar b[CartesianIndex()] = 2; b),
196+
# Regression test for https://github.com/ITensor/BlockSparseArrays.jl/issues/27.
197+
(b = copy(a); @allowscalar b[Block()] = dev(fill(2)); b),
195198
)
196199
@test size(b) == ()
197200
@test isone(length(b))
@@ -202,8 +205,7 @@ arrayts = (Array, JLArray)
202205
@test @allowscalar(b[CartesianIndex()]) == 2
203206
@test b[Block()] == dev(fill(2))
204207
@test @allowscalar(b[Block()][]) == 2
205-
# Broken:
206-
## @test b[Block()[]] == 2
208+
@test b[Block()[]] == 2
207209
end
208210
end
209211

0 commit comments

Comments
 (0)