Simple Math tests

Calling `assert` within the `Enum.map` makes the errors more usable.
This commit is contained in:
William Carroll 2020-12-12 01:36:22 +00:00
parent ee96a818e1
commit 686766929a

View file

@ -11,10 +11,8 @@ defmodule MathTest do
{21, [3, 7]}
]
|> Enum.map(fn {input, expected} ->
Math.factor(input) == expected
assert Math.factor(input) == expected
end)
|> Enum.all?()
|> assert
end
test "handles large numbers" do