Establish that modules are atoms, then show function call on them
This commit is contained in:
@@ -20,12 +20,10 @@ defmodule Atoms do
|
|||||||
|
|
||||||
koan "Modules are also atoms" do
|
koan "Modules are also atoms" do
|
||||||
assert is_atom(String) == ___
|
assert is_atom(String) == ___
|
||||||
assert :"Elixir.String" == ___
|
|
||||||
assert :"Elixir.String".upcase("hello") == ___
|
|
||||||
end
|
end
|
||||||
|
|
||||||
koan "Atoms are used to access Erlang" do
|
koan "Functions can be called on the atom too" do
|
||||||
assert :erlang.is_list([]) == ___
|
assert :"Elixir.String" == String
|
||||||
assert :lists.sort([2, 3, 1]) == ___
|
assert :"Elixir.String".upcase("hello") == ___
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ defmodule AtomsTests do
|
|||||||
:human,
|
:human,
|
||||||
{:multiple, [:atomized, "stringified"]},
|
{:multiple, [:atomized, "stringified"]},
|
||||||
{:multiple, [true, true, true, false]},
|
{:multiple, [true, true, true, false]},
|
||||||
{:multiple, [true, String, "HELLO"]},
|
true,
|
||||||
{:multiple, [true, [1,2,3]]},
|
"HELLO",
|
||||||
]
|
]
|
||||||
|
|
||||||
test_all(Atoms, answers)
|
test_all(Atoms, answers)
|
||||||
|
|||||||
Reference in New Issue
Block a user