Skip to content

Commit

Permalink
update test to count number of points per extrema
Browse files Browse the repository at this point in the history
  • Loading branch information
ffreyer committed Oct 10, 2024
1 parent 8cc2f99 commit c2b2056
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,15 @@ end
@test fs |> extrema |> collect |> diff |> first > 1.9
end

let f = sinc, int = (0, 40) # JuliaPlots/Plots.jl/issues/3894
xs, fs = adapted_grid(f, int)
@test length(xs) > 400
let f = sinc, int = (-40, 40) # JuliaPlots/Plots.jl/issues/3894
xs, fs = adapted_grid(sinc, int)
roots = vcat(int[1]:-1, 1:int[2])
count_per_extrema = map(1:length(roots)-1) do idx
left = roots[idx]; right = roots[idx+1]
return count(x -> left < x < right, xs)
end
# check that we have at least 5 points for each extrema
@test all(count_per_extrema .>= 5)
end
end

Expand Down

0 comments on commit c2b2056

Please sign in to comment.