Skip to content

Commit

Permalink
Change new test case to only run for julia v1.3+
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Jun 19, 2023
1 parent 6f550f0 commit b18fd2e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
10 changes: 6 additions & 4 deletions test/pkgs/PkgWithAmbiguities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ module PkgWithAmbiguities
f(::Any, ::Int) = 1
f(::Int, ::Any) = 2

abstract type AbstractType{T} end
struct ConcreteType{T} <: AbstractType{T} end
(::AbstractType{T})(::Tuple{Tuple{Int}}) where {T} = 1
(::ConcreteType)(::Tuple) = 2
@static if VERSION >= v"1.3-"
abstract type AbstractType{T} end
struct ConcreteType{T} <: AbstractType{T} end
(::AbstractType{T})(::Tuple{Tuple{Int}}) where {T} = 1
(::ConcreteType)(::Tuple) = 2
end

end # module
38 changes: 24 additions & 14 deletions test/test_ambiguities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,33 @@ include("preamble.jl")
using PkgWithAmbiguities

@testset begin
results = @testtestset begin
@info "↓↓↓ Following failures are expected. ↓↓↓"
Aqua.test_ambiguities(PkgWithAmbiguities)
@static if VERSION >= v"1.3-"
results = @testtestset begin
@info "↓↓↓ Following failures are expected. ↓↓↓"
Aqua.test_ambiguities(PkgWithAmbiguities)

# exclude just anything irrelevant, see #49
Aqua.test_ambiguities(PkgWithAmbiguities; exclude = [convert])
# exclude just anything irrelevant, see #49
Aqua.test_ambiguities(PkgWithAmbiguities; exclude = [convert])

Aqua.test_ambiguities(
PkgWithAmbiguities;
exclude = [PkgWithAmbiguities.f, PkgWithAmbiguities.AbstractType],
)
@info "↑↑↑ Above failures are expected. ↑↑↑" # move above once broken test fixed
Aqua.test_ambiguities(
PkgWithAmbiguities;
exclude = [PkgWithAmbiguities.f, PkgWithAmbiguities.AbstractType],
)
@info "↑↑↑ Above failures are expected. ↑↑↑" # move above once broken test fixed
end
@test length(results) == 3
@test results[1] isa Test.Fail
@test results[2] isa Test.Fail
@test_broken results[3] isa Test.Pass
else
results = @testtestset begin
@info "↓↓↓ Following failures are expected. ↓↓↓"
Aqua.test_ambiguities(PkgWithAmbiguities)
@info "↑↑↑ Above failures are expected. ↑↑↑"
end
@test length(results) == 1
@test results[1] isa Test.Fail
end
@test length(results) == 3
@test results[1] isa Test.Fail
@test results[2] isa Test.Fail
@test_broken results[3] isa Test.Pass

# It works with other tests:
Aqua.test_unbound_args(PkgWithAmbiguities)
Expand Down

0 comments on commit b18fd2e

Please sign in to comment.