[WIP] Implement growth assessment using WHO indicators #80

Draft
joao.dubas wants to merge 76 commits from jpd-feat-add-bmi-module-with-live-view into main
Showing only changes of commit 1e36c29180 - Show all commits

View File

@ -0,0 +1,26 @@
defmodule Growth.Calc.PercentileTest do
@moduledoc false
use ExUnit.Case, async: true
doctest Growth.Calc.Percentile
alias Growth.Calc.Percentile
describe "compute/1" do
for {zscore, percentile} = params <- [
{-3, 0.0013498125},
{-2, 0.0227502617},
{-1, 0.1586553192},
{0, 0.5000000000},
{1, 0.8413446808},
{2, 0.9772497383},
{3, 0.9986501875}
] do
@tag params: params
test "returns the percentile for z-score #{zscore}", %{params: {zscore, percentile}} do
assert_in_delta Percentile.compute(zscore), percentile, 0.0000005
end
end
end
end