Establish that modules are atoms, then show function call on them

This commit is contained in:
Jay Hayes
2016-05-05 10:43:17 -05:00
parent 948fbddcdf
commit ad011d80f3
2 changed files with 5 additions and 7 deletions

View File

@@ -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

View File

@@ -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)