Skip to content

Commit

Permalink
Expand tests for #39798
Browse files Browse the repository at this point in the history
  • Loading branch information
mkitti committed Mar 28, 2021
1 parent b81be51 commit 52476fa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/ranges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1900,8 +1900,11 @@ end
@test_throws BoundsError r[true:true:true]
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) ]
for T in DataType[Float16,Float32,Float64,Bool,Int8,Int16,Int32,Int64,Int128,UInt8,UInt16,UInt32,UInt64,UInt128],
r in [ LinRange(1, 1, 10), StepRangeLen(7, 0, 5) ]
if first(r) > typemax(T)
continue
end
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
Expand Down

0 comments on commit 52476fa

Please sign in to comment.