Skip to content

Commit

Permalink
Specify Int64, use @test broken argument
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Holters <martin.holters@hsu-hh.de>
  • Loading branch information
wheeheee and martinholters authored Jan 30, 2025
1 parent 0148012 commit 672ba0b
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions test/resample.jl
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,16 @@ end
@testset "FIRFilter types" begin
using DSP.Filters: FIRStandard, FIRInterpolator
# test FIRRational(::Vector, ::Int(/Int32)) inferred result type
if VERSION >= v"1.11"
FIRFutyp = Union{FIRFilter{<:FIRInterpolator},FIRFilter{<:FIRStandard}}
@test only(Base.return_types(FIRFilter, (Vector, Int))) == FIRFutyp
@test only(Base.return_types(FIRFilter, (Vector, Int32))) == FIRFutyp
end
FIRFutyp = Union{FIRFilter{<:FIRInterpolator},FIRFilter{<:FIRStandard}}
@test only(Base.return_types(FIRFilter, (Vector, Int64))) <: FIRFutyp broken=VERSION<v"1.11"
@test only(Base.return_types(FIRFilter, (Vector, Int32))) <: FIRFutyp broken=VERSION<v"1.11"
FIRFutype{T} = Union{FIRFilter{FIRInterpolator{T}},FIRFilter{FIRStandard{T}}} where T
@test only(Base.return_types(FIRFilter, (Vector{Float64}, Int))) == FIRFutype{Float64}
@test only(Base.return_types(FIRFilter, (Vector{Float64}, Int64))) == FIRFutype{Float64}
@test only(Base.return_types(FIRFilter, (Vector{Float64}, Int32))) == FIRFutype{Float64}

# check that non-Int / Rational{Int} ratios get converted properly
x = rand(200)
@test resample(x, Int32(3)) == resample(x, 3)
@test resample(x, Rational{Int32}(1, 3)) == resample(x, 1 // 3)
@test resample(x, Rational{Int32}(2, 3)) == resample(x, 2 // 3)
@test resample(x, Int32(3)) == resample(x, Int64(3))
@test resample(x, Rational{Int32}(1, 3)) == resample(x, Rational{Int64}(1, 3))
@test resample(x, Rational{Int32}(2, 3)) == resample(x, Rational{Int64}(2, 3))
end

0 comments on commit 672ba0b

Please sign in to comment.