diff --git a/test/runtests.jl b/test/runtests.jl index b5a0133..ea213d2 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -398,15 +398,20 @@ end end @testset "multiargument methods" begin - @test @checked(1 + 4 + 5) == 10 - @test_throws OverflowError @checked(typemax(Int) + 1 + 4 + 5) - @test_throws OverflowError @checked(1 + 4 + 5 + typemax(Int)) - @test @checked(1.0 + 4 + 5 + typemax(Int)) == 9.223372036854776e18 + @test @checked(+(1, 4, 5)) == 10 + @test_throws OverflowError @checked(+(typemax(Int), 1, 4, 5)) + @test_throws OverflowError @checked(+(1, 4, 5, typemax(Int))) + @test @checked(+(1.0, 4, 5, typemax(Int))) == 9.223372036854776e18 - @test @unchecked(1 + 4 + 5) == 10 - @test @unchecked(typemax(Int) + 1 + 4 + 5) == 10 + typemax(Int) - @test @unchecked(1 + 4 + 5 + typemax(Int)) == 10 + typemax(Int) - @test @checked(1.0 + 4 + 5 + typemax(Int)) == 9.223372036854776e18 + @test @unchecked(+(1, 4, 5)) == 10 + @test @unchecked(+(typemax(Int), 1, 4, 5)) == 10 + typemax(Int) + @test @unchecked(+(1, 4, 5, typemax(Int))) == 10 + typemax(Int) + @test @unchecked(+(1.0, 4, 5, typemax(Int))) == 9.223372036854776e18 + + @test @saturating(+(1, 4, 5)) == 10 + @test @saturating(+(typemax(Int), 1, 4, 5)) == typemax(Int) + @test @saturating(+(1, 4, 5, typemax(Int))) == typemax(Int) + @test @saturating(+(1.0, 4, 5, typemax(Int))) == 9.223372036854776e18 end using SaferIntegers