Skip to content

Commit

Permalink
increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
dlfivefifty committed Feb 28, 2021
1 parent e2ad85d commit 29e3ec2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ArrayLayouts = "0.6"
DSP = "0.6"
FillArrays = "0.11"
Infinities = "0.0.2"
LazyArrays = "0.21"
LazyArrays = "0.21.1"
julia = "1.5"

[extras]
Expand Down
19 changes: 19 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,16 @@ import Base.Broadcast: broadcasted, Broadcasted, instantiate

@test similar(a, Float64, (2,∞)) isa CachedArray{Float64}
@test similar(a, Float64, (∞,2)) isa CachedArray{Float64}

@test similar(Array{Float64}, (∞,)) isa CachedArray{Float64}
@test similar(Array{Float64}, (∞,∞)) isa CachedArray{Float64}
@test similar(Array{Float64}, (2,∞)) isa CachedArray{Float64}
@test similar(Array{Float64}, (∞,2)) isa CachedArray{Float64}

@test similar(Array{Float64}, (oneto(∞),)) isa CachedArray{Float64}
@test similar(Array{Float64}, (oneto(∞),oneto(∞))) isa CachedArray{Float64}
@test similar(Array{Float64}, (oneto(∞),oneto(5))) isa CachedArray{Float64}
@test similar(Array{Float64}, (oneto(5),oneto(∞))) isa CachedArray{Float64}
end

@testset "zeros/fill/ones" begin
Expand Down Expand Up @@ -83,6 +91,10 @@ import Base.Broadcast: broadcasted, Broadcasted, instantiate
@test ones(5,∞)[:,1:10] == ones(5,10)
@test ones(∞,5)[1:10,:] == ones(10,5)
@test ones(∞,∞)[1:5,1:5] == ones(5,5)

@test zeros(∞, 5)[1:10,:] == zeros(10,5)
@test zeros(Int, ∞, 5)[1:10,:] == zeros(10,5)
@test zeros(Int, 5, ∞)[:,1:10] == zeros(5, 10)
end
end

Expand Down Expand Up @@ -490,6 +502,13 @@ end
@test @inferred(broadcast(*,Ones(∞)',D)) == @inferred(broadcast(*,D,Ones(∞)')) == Diagonal(1.0:∞)
@test @inferred(broadcast(*,Fill(2,∞)',D)) @inferred(broadcast(*,D,Fill(2,∞)')) 2D

@test Eye{Int}(∞, ∞) isa Eye{Int}
@test Eye{Int}(∞, 5) isa Eye{Int}
@test Eye{Int}(5, ∞) isa Eye{Int}
@test Eye(∞, ∞) isa Eye{Float64}
@test Eye(∞, 5) isa Eye{Float64}
@test Eye(5, ∞) isa Eye{Float64}

@test Eye{Int}(∞) * D Eye{Int}(∞) * D D
@test Eye(∞) * D == Eye(∞) * D == D
end
Expand Down

0 comments on commit 29e3ec2

Please sign in to comment.