Skip to content

Commit 8370b55

Browse files
committed
Add a few more tests.
1 parent 9a422f8 commit 8370b55

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/static.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ end
135135

136136
@inline Base.widen(::StaticInt{N}) where {N} = widen(N)
137137

138-
Base.UnitRange{T}(start::StaticInt, stop) where {T<:Real} = UnitRange{T}(T(start), stop)
139-
Base.UnitRange{T}(start, stop::StaticInt) where {T<:Real} = UnitRange{T}(start, T(stop))
138+
Base.UnitRange{T}(start::StaticInt, stop) where {T<:Real} = UnitRange{T}(T(start), T(stop))
139+
Base.UnitRange{T}(start, stop::StaticInt) where {T<:Real} = UnitRange{T}(T(start), T(stop))
140140
function Base.UnitRange{T}(start::StaticInt, stop::StaticInt) where {T<:Real}
141141
return UnitRange{T}(T(start), T(stop))
142142
end

test/runtests.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,13 @@ end
597597
@test convert(typeof(z), @inferred(f(2 // 7, i))) === z
598598
end
599599
end
600+
601+
@test UnitRange{Int16}(StaticInt(-9), 17) === Int16(-9):Int16(17)
602+
@test UnitRange{Int16}(-7, StaticInt(19)) === Int16(-7):Int16(19)
603+
@test UnitRange(-11, StaticInt(15)) === -11:15
604+
@test UnitRange(StaticInt(-11), 15) === -11:15
605+
@test UnitRange(StaticInt(-11), StaticInt(15)) === -11:15
606+
@test float(StaticInt(8)) === 8.0
600607
end
601608

602609
@testset "insert/deleteat" begin

0 commit comments

Comments
 (0)