Skip to content

Commit 9a8e6b2

Browse files
committed
add tests
1 parent f36afb2 commit 9a8e6b2

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/banded/infbanded.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ sub_materialize(::AbstractBandedLayout, V, ::Tuple{InfAxes,OneTo{Int}}) = V
375375
@inline sub_materialize(::BandedColumns, V, ::Tuple{InfAxes,InfAxes}) = BandedMatrix(V)
376376

377377
sub_materialize(_, V, ::Tuple{<:BlockedUnitRange{<:InfRanges}}) = V
378+
sub_materialize(::AbstractBlockLayout, V, ::Tuple{<:BlockedUnitRange{<:InfRanges}}) = V
378379

379380
##
380381
# UniformScaling

test/runtests.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,24 @@ end
134134
n = Fill.(oneto(∞),oneto(∞))
135135
@test broadcast(length,k) map(length,k) OneToInf()
136136
@test broadcast(length,n) map(length,n) OneToInf()
137+
137138
b = mortar(Fill([1,2],∞))
138139
@test blockaxes(b,1) Block.(OneToInf())
139140
@test b[Block(5)] == [1,2]
141+
@test b[Block.(2:∞)][Block.(2:10)] == b[Block.(3:11)]
142+
@test exp.(b)[Block.(2:∞)][Block.(2:10)] == exp.(b[Block.(3:11)])
143+
144+
c = PseudoBlockArray(1:∞,Vcat(2,Fill(3,∞)))
145+
@test c[Block.(2:∞)][Block.(2:10)] == c[Block.(3:11)]
146+
140147
@test length(axes(b,1)) ℵ₀
141148
@test last(axes(b,1)) RealInfinity()
142149
@test Base.BroadcastStyle(typeof(b)) isa LazyArrayStyle{1}
150+
151+
@test unitblocks(oneto(∞)) blockedrange(Ones{Int}(∞))
152+
@test unitblocks(2:∞) == 2:
153+
154+
@test unitblocks(oneto(∞))[Block.(2:∞)] == 2:
143155
end
144156

145157
@testset "1:∞ blocks" begin

0 commit comments

Comments
 (0)