Skip to content

Commit

Permalink
Improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
halleysfifthinc committed Sep 5, 2022
1 parent 0e9c6e2 commit 796917e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
using VaxData, Test, InteractiveUtils

@testset "General" begin
# Overflowing conversion
@test_throws InexactError convert(VaxFloatF, big"1.7e39")

@test sprint(show, vaxf"1.0") == "vaxf\"1.0\""

@test -one(VaxFloatF) < one(VaxFloatF)
@test one(VaxFloatF) < nextfloat(one(VaxFloatF))

@test -one(VaxFloatF) <= one(VaxFloatF)
@test one(VaxFloatF) <= nextfloat(one(VaxFloatF))

@test prevfloat(one(VaxFloatF), -5) === nextfloat(one(VaxFloatF), 5)
end

include("vaxints.jl")
include("vaxfloatf.jl")
include("vaxfloatd.jl")
Expand Down
3 changes: 3 additions & 0 deletions test/vaxfloatd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@
@test VaxFloatD(prevfloat(convert(Float64, floatmin(VaxFloatD)))) === zero(VaxFloatD)
@test VaxFloatD(convert(Float64, floatmin(VaxFloatD))) === floatmin(VaxFloatD)

# Subnormals become zero
@test VaxFloatD(prevfloat(floatmin(Float64))) == zero(VaxFloatD)

# Numbers larger than floatmax(VaxFloatD) should error
@test_throws InexactError VaxFloatD(nextfloat(convert(Float64, floatmax(VaxFloatD))))

Expand Down

0 comments on commit 796917e

Please sign in to comment.