Skip to content

Commit

Permalink
Test for #39798
Browse files Browse the repository at this point in the history
  • Loading branch information
mkitti committed Feb 24, 2021
1 parent 501f485 commit 3cd950d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/ranges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1752,3 +1752,18 @@ end
@test eltype(StepRangeLen(Int8(1), Int8(2), 3, 2)) === Int8
@test typeof(step(StepRangeLen(Int8(1), Int8(2), 3, 2))) === Int8
end

@testset "Non-Int64 endpoints that are identical (#39798)" begin
for T in DataType[Float64,Int8,Int16,Int32,Int64,Int128,UInt8,UInt16,UInt32,UInt64],
r in [ LinRange(1, 1, 10), StepRangeLen(7, 0 , 5) ]
let start=T(first(r)), stop=T(last(r)), step=T(step(r)), length=length(r)
@test range( start, stop, length) == r
@test range( start, stop; length) == r
@test range( start; stop, length) == r
@test range(; start, stop, length) == r
@test range( start; step, length) == r
@test range(; start, step, length) == r
@test range(; stop, step, length) == r
end
end
end

0 comments on commit 3cd950d

Please sign in to comment.