Skip to content

Commit

Permalink
add tests for #51113
Browse files Browse the repository at this point in the history
  • Loading branch information
Lilith Hafner authored and Lilith Hafner committed Aug 30, 2023
1 parent a7f115a commit 45d5b2e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/floatfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ end
result = result !== error && typemin(Ti) <= result <= typemax(Ti) ? result : error

if result === error
# @test_throws InexactError round(Ti, z) Broken because of #51113
@test_throws InexactError round(Ti, z)
@test_throws InexactError Ti(z)
else
@test result == round(Ti, z)
Expand Down
7 changes: 7 additions & 0 deletions test/rounding.jl
Original file line number Diff line number Diff line change
Expand Up @@ -448,3 +448,10 @@ const native_rounding_modes = (
end
end
end

@testset "round(Int, -Inf16) should throw (#51113)" begin
@test_throws InexactError round(Int32, -Inf16)
@test_throws InexactError round(Int64, -Inf16)
@test_throws InexactError round(Int128, -Inf16)
# More comprehensive testing is present in test/floatfuncs.jl
end

0 comments on commit 45d5b2e

Please sign in to comment.