Skip to content

Commit 3cd950d

Browse files
committed
Test for #39798
1 parent 501f485 commit 3cd950d

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

test/ranges.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1752,3 +1752,18 @@ end
17521752
@test eltype(StepRangeLen(Int8(1), Int8(2), 3, 2)) === Int8
17531753
@test typeof(step(StepRangeLen(Int8(1), Int8(2), 3, 2))) === Int8
17541754
end
1755+
1756+
@testset "Non-Int64 endpoints that are identical (#39798)" begin
1757+
for T in DataType[Float64,Int8,Int16,Int32,Int64,Int128,UInt8,UInt16,UInt32,UInt64],
1758+
r in [ LinRange(1, 1, 10), StepRangeLen(7, 0 , 5) ]
1759+
let start=T(first(r)), stop=T(last(r)), step=T(step(r)), length=length(r)
1760+
@test range( start, stop, length) == r
1761+
@test range( start, stop; length) == r
1762+
@test range( start; stop, length) == r
1763+
@test range(; start, stop, length) == r
1764+
@test range( start; step, length) == r
1765+
@test range(; start, step, length) == r
1766+
@test range(; stop, step, length) == r
1767+
end
1768+
end
1769+
end

0 commit comments

Comments
 (0)