Skip to content

Commit

Permalink
test: less strict type signature
Browse files Browse the repository at this point in the history
  • Loading branch information
ymtoo committed May 28, 2021
1 parent 4132384 commit fcf65fc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ using Test
@test all(isapprox.(rightips1 ,[8.75, 13.0, 16.875, 16.375, 20.0], atol=0.001))

pkindices1, _ = findpeaks1d(x, prominence=0.1, width=3.0, relheight=1.0)
@test pkindices1 == [6,14]
pkindices2, _ = findpeaks1d(x, prominence=0.3, width=2.0, relheight=0.5)
@test pkindices2 == [6]
# test for less strict type signature
pkindices1, _ = findpeaks1d(x, prominence=1//10, width=3, relheight=1.0)
@test pkindices1 == [6,14]
pkindices2, _ = findpeaks1d(x, prominence=0.3, width=2, relheight=1//2)
@test pkindices2 == [6]

@test_throws ArgumentError pkindiceswlenerror, _ = findpeaks1d(x, prominence=0.3, wlen=0)

Expand Down

0 comments on commit fcf65fc

Please sign in to comment.