Skip to content
This repository has been archived by the owner on May 21, 2022. It is now read-only.

Commit

Permalink
Add tests for centering
Browse files Browse the repository at this point in the history
  • Loading branch information
abieler committed Jun 26, 2017
1 parent 556a48d commit 7588257
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/tst_center.jl
Expand Up @@ -110,6 +110,26 @@ end
@test all(DD[:C] .== D[:C])
@test all(mu .== [mean(D[:A]), mean(D[:B])])

DD = deepcopy(D_NA)
mu = center!(DD, [:A, :B, :C])
@test abs.(mean(DD[:B])) <= 10e-10
@test all(DD[2:end, :A] .== D[2:end, :A])
@test all(DD[:C] .== D[:C])

DD = deepcopy(D_NA)
mu = [0.0, mean(DD[:B]), 0.0]
mu = center!(DD, mu, [:A, :B, :C])
@test abs.(mean(DD[:B])) <= 10e-10
@test all(DD[2:end, :A] .== D[2:end, :A])
@test all(DD[:C] .== D[:C])

DD = deepcopy(D_NA)
mu = 0.0
mu = center!(DD, mu, :A)
@test all(DD[2:end, :A] .== D[2:end, :A])
@test all(DD[:B] .== D[:B])
@test all(DD[:C] .== D[:C])

DD = deepcopy(D)
mu = [mean(D[:A]), mean(D[:B])]
@test all(center!(DD, mu, operate_on=[:A, :B]) .== mu)
Expand Down

0 comments on commit 7588257

Please sign in to comment.