
I think is better to continue use safe ```Map.fetch``` until we familiarize users with dangerous function concept. Not every body comes from ruby background, with knowledge of ```?``` and ```!``` function notations. test ifx
18 lines
260 B
Elixir
18 lines
260 B
Elixir
defmodule StructsTests do
|
|
use ExUnit.Case
|
|
import TestHarness
|
|
|
|
test "Structs" do
|
|
answers = [
|
|
%Structs.Person{},
|
|
nil,
|
|
"Joe",
|
|
33,
|
|
{:multiple, [true, false]},
|
|
{:ok, 22},
|
|
]
|
|
|
|
test_all(Structs, answers)
|
|
end
|
|
end
|