Extract answers from PatternMatching module

This commit is contained in:
Felipe Sere
2016-03-16 21:53:29 +00:00
parent 56b6679a69
commit 243a8a07d8
2 changed files with 53 additions and 22 deletions

View File

@@ -163,6 +163,27 @@ defmodule KoansHarnessTest do
test_all(Structs, answers)
end
test "Pattern Matching" do
answers = [
1,
2,
1,
1,
[2,3,4],
[1,2,3,4],
3,
"eggs, milk",
"Honda",
[1,2,3],
"Woof",
"Meow",
"Eh?",
"not present"
]
test_all(PatternMatching, answers)
end
def test_all(module, answers) do
module.all_koans
|> Enum.zip(answers)