Skip to content

Commit

Permalink
Simplify criterion in "arbitrary ratio" test
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters committed Nov 28, 2024
1 parent 5436f7a commit 44a3358
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/resample.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,17 @@ end
idxLower = round(Int, yLen/3)
idxUpper = idxLower*2
yDelta = abs.(y[idxLower:idxUpper].-yy[idxLower:idxUpper])
@test all(map(delta -> abs(delta) < 0.00025, yDelta))
@test maximum(yDelta) < 0.00025

# Test Float32 ratio (#302)
f32_ratio = convert(Float32, ratio)
f32_y = resample(x, f32_ratio)
ty = range(0, length=yLen, step=step(tx)/ratio)
ty = range(0, length=yLen, step=step(tx)/f32_ratio)
yy = sinpi.(2*ty)
idxLower = round(Int, yLen/3)
idxUpper = idxLower*2
yDelta = abs.(f32_y[idxLower:idxUpper].-yy[idxLower:idxUpper])
@test all(map(delta -> abs(delta) < 0.00025, yDelta))
@test maximum(yDelta) < 0.00025
end

@testset "arbitrary ratio" begin
Expand Down

0 comments on commit 44a3358

Please sign in to comment.