Skip to content

Commit 31c5390

Browse files
committed
Infinite broadcast tests (#383)
1 parent 90f91ce commit 31c5390

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Aqua = "0.8"
1212
ArrayLayouts = "1.0.8"
1313
Documenter = "1"
1414
FillArrays = "1"
15+
InfiniteArrays = "0.13"
1516
LinearAlgebra = "1.6"
1617
OffsetArrays = "1"
1718
Random = "1.6"
@@ -23,11 +24,12 @@ julia = "1.6"
2324
[extras]
2425
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
2526
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
27+
InfiniteArrays = "4858937d-0d70-526a-a4dd-2d5cb5dd786c"
2628
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
2729
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
2830
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
2931
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
3032
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
3133

3234
[targets]
33-
test = ["Aqua", "Documenter", "OffsetArrays", "SparseArrays", "StaticArrays", "Test", "Random"]
35+
test = ["Aqua", "Documenter", "InfiniteArrays", "OffsetArrays", "SparseArrays", "StaticArrays", "Test", "Random"]

test/test_blockbroadcast.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using BlockArrays, FillArrays, Test
22
import BlockArrays: SubBlockIterator, BlockIndexRange, Diagonal
3+
import InfiniteArrays
34

45
@testset "broadcast" begin
56
@testset "BlockArray" begin
@@ -122,6 +123,14 @@ import BlockArrays: SubBlockIterator, BlockIndexRange, Diagonal
122123
@test (@. z = x + y + z; z) == (@. z2 = x2 + y2 + z2; z2)
123124
end
124125

126+
@testset "blockedrange" begin
127+
b = blockedrange(InfiniteArrays.OneToInf())
128+
b2 = b .+ b
129+
for i in 1:10
130+
@test b2[Block(i)] == b[Block(i)] + b[Block(i)]
131+
end
132+
end
133+
125134
@testset "Special broadcast" begin
126135
v = mortar([1:3,4:7])
127136
@test broadcast(+, v) isa BlockVector{Int,Vector{UnitRange{Int}}}

0 commit comments

Comments
 (0)