Start basic pattern matching koans

This commit is contained in:
Uku Taht
2016-03-07 16:45:23 +02:00
parent e6aa96bf1a
commit 1a19c30ec1
3 changed files with 68 additions and 1 deletions

View File

@@ -29,6 +29,10 @@ defmodule BlankAssertions do
ExUnit.Assertions.assert(value, opts)
end
def refute(value, opts) do
ExUnit.Assertions.refute(value, opts)
end
defp contains_blank?(expr) do
{_, blank} = Macro.prewalk(expr, false, &blank?/2)
blank