Skip to content

Commit

Permalink
Merge pull request #11 from putianyi889/version-0.0.3.1
Browse files Browse the repository at this point in the history
fix #10
  • Loading branch information
putianyi889 authored Mar 14, 2024
2 parents 4feaae7 + 706f738 commit a000f9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/EltypeExtensions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ $(repr("text/plain", Matrix{Float64}))
"""
elconvert(::Type{T}, A::AbstractArray) where T = AbstractArray{T}(A)
elconvert(::Type{T}, A::AbstractRange) where T = T(first(A)):T(step(A)):T(last(A))
elconvert(::Type{T}, A::AbstractUnitRange) where T<:Integer = AbstractUnitRange{T}(A)
elconvert(::Type{T}, A::AbstractSet) where T = AbstractSet{T}(A)

"""
Expand Down
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ using Aqua
@testset "#8" begin
@test precisionconvert(Int128, Int8(1)//Int8(2)) isa Rational{Int128}
end

@testset "#10" begin
@test elconvert(Int32, 1:5) === Int32(1):Int32(5)
end
end

@testset "Doctest" begin
Expand Down

0 comments on commit a000f9c

Please sign in to comment.