Parameterized testing with ExUnit

I do not get why do you need attribute at all. Why not:

for {lhs, rhs} <- [{"one", 1}, {"two", 2}, {"three", 3}] do
  test "#{lhs} convert to #{rhs}" do
    assert unquote(lhs) == unquote(rhs)
  end
end
8 Likes