Skip to content

Commit

Permalink
add & fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ffreyer committed Feb 17, 2021
1 parent 5b96973 commit d995969
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/incrementbinner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
xs = indices(B)
ys = values(B)

@test xs == Float64[1,2,3,4, 5.5,6.5,7.5,8.5, 11.5,15.5,19.5,23.5]
@test xs == Float64[1,2,3,4, 5.5,7.5,9.5,11.5, 14.5,18.5,22.5,26.5]
@test ys == Float64[1,1,1,1, 2,2,2,2, 4,4,4,4]
end

@testset "ComplexF64" begin
B = IncrementBinner(ComplexF64, blocksize=3)

@test B.keep == 4
@test B.keep == 3

for i in 1:3
push!(B, 1.0+1.0im)
Expand All @@ -40,8 +40,8 @@ end
xs = indices(B)
ys = values(B)

@test xs == Float64[1,2,3, 4.5,5.5,6.5]
@test ys == Complex64[1+1im,1+1im,1+1im, 2+2im,2+2im,2+2im]
@test xs == Float64[1,2,3, 4.5,6.5,8.5]
@test ys == ComplexF64[1+1im,1+1im,1+1im, 2+2im,2+2im,2+2im]
end

@testset "Vector" begin
Expand Down
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ using Test, Statistics, Random
include("errorpropagator.jl")
end

@testset "Incremental Binning" begin
include("incrementbinner.jl")
end

@testset "Generic functions" begin
x = [0.0561823, 0.846613, 0.813439, 0.357134, 0.157445, 0.103298, 0.948842, 0.629425, 0.290206, 0.00695332, 0.869828, 0.949165, 0.897995, 0.916239, 0.457564, 0.349827, 0.398683, 0.264218, 0.72754, 0.934315, 0.666448, 0.134813, 0.364933, 0.829088, 0.256443, 0.595029, 0.172097, 0.241686, 0.489935, 0.239663, 0.391291, 0.00751015, 0.138935, 0.0569876, 0.571786, 0.694996, 0.798602, 0.923308, 0.73978, 0.414774, 0.835145, 0.731303, 0.271647, 0.707796, 0.00348624, 0.0905812, 0.316176, 0.921054, 0.131037, 0.599667, 0.805071, 0.440813, 0.086516, 0.363658, 0.476161, 0.931257, 0.28974, 0.78717, 0.60822, 0.144024, 0.214432, 0.061922, 0.626495, 0.512072, 0.758078, 0.840485, 0.242576, 0.147441, 0.599222, 0.993569, 0.0365044, 0.0983033, 0.713144, 0.422394, 0.480044, 0.968745, 0.518475, 0.431319, 0.4432, 0.526007, 0.612975, 0.468387, 0.262145, 0.888011, 0.105744, 0.325821, 0.769525, 0.289073, 0.336083, 0.443037, 0.489698, 0.141654, 0.915284, 0.319068, 0.341001, 0.704346, 0.0794996, 0.0412352, 0.70016, 0.0195158]
Expand Down

0 comments on commit d995969

Please sign in to comment.