Skip to content

Commit

Permalink
Add tests provided by Aqua.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
lbenet committed Oct 12, 2024
1 parent 429ad16 commit e968b12
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/aqua.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using Test
using IntervalArithmetic
using Aqua

@testset "Aqua tests (performance)" begin
# This tests that we don't accidentally run into
# https://github.com/JuliaLang/julia/issues/29393
# Aqua.test_unbound_args(IntervalArithmetic)
ua = Aqua.detect_unbound_args_recursively(IntervalArithmetic)
@test length(ua) == 0

# See: https://github.com/SciML/OrdinaryDiffEq.jl/issues/1750
# Test that we're not introducing method ambiguities across deps
ambs = Aqua.detect_ambiguities(IntervalArithmetic; recursive = true)
pkg_match(pkgname, pkdir::Nothing) = false
pkg_match(pkgname, pkdir::AbstractString) = occursin(pkgname, pkdir)
filter!(x -> pkg_match("IntervalArithmetic", pkgdir(last(x).module)), ambs)
for method_ambiguity in ambs
@show method_ambiguity
end
if VERSION < v"1.10.0-DEV"
@test length(ambs) == 0
end
end

@testset "Aqua tests (additional)" begin
Aqua.test_undefined_exports(IntervalArithmetic)
# Aqua.test_deps_compat(IntervalArithmetic)
Aqua.test_stale_deps(IntervalArithmetic)
Aqua.test_piracies(IntervalArithmetic)
Aqua.test_unbound_args(IntervalArithmetic)
Aqua.test_project_extras(IntervalArithmetic)
Aqua.test_persistent_tasks(IntervalArithmetic)
end
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ for f ∈ readdir("ITF1788_tests"; join = true)
include(f)
end
end

# Aqua tests
include("aqua.jl")

0 comments on commit e968b12

Please sign in to comment.