Skip to content

Commit

Permalink
Add Float64 range test
Browse files Browse the repository at this point in the history
Added test for one-dimensional range with Float64 values, rounded off to 4 significant digits.
  • Loading branch information
adarshpalaskar1 committed Feb 2, 2024
1 parent 387e7f3 commit 02af6e0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/hyperparam/one_dimensional_ranges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,13 @@ end
io = IOBuffer()
r1 = range(Int, :junk, lower=1, upper=10)
r2 = range(Char, :junk, values=['c', 'd'])
r3 = range(Float64, :junk, lower=3.14159, upper=6.283185)
show(io, r1)
@test String(take!(io)) == "NumericRange(1 ≤ junk ≤ 10; origin=5.5, unit=4.5)"
show(io, r2)
@test String(take!(io)) == "NominalRange(junk = c, d)"
show(io, r3)
@test String(take!(io)) == "NumericRange(3.142 ≤ junk ≤ 6.283; origin=4.712, unit=1.571)"
close(io)
end

Expand Down

0 comments on commit 02af6e0

Please sign in to comment.