Make list sigil lessons a little more challenging
This commit is contained in:
@@ -25,15 +25,15 @@ defmodule Sigils do
|
|||||||
end
|
end
|
||||||
|
|
||||||
koan "The ~w sigil creates word lists" do
|
koan "The ~w sigil creates word lists" do
|
||||||
assert ~w(Hello world) == [___, ___]
|
assert ~w(Hello world) == ___
|
||||||
end
|
end
|
||||||
|
|
||||||
koan "The ~w sigil also allows interpolation" do
|
koan "The ~w sigil also allows interpolation" do
|
||||||
assert ~w(Hello 1#{1+1}3) == [___, ___]
|
assert ~w(Hello 1#{1+1}3) == ___
|
||||||
end
|
end
|
||||||
|
|
||||||
koan "The ~W sigil behaves to ~w as ~S behaves to ~s" do
|
koan "The ~W sigil behaves to ~w as ~S behaves to ~s" do
|
||||||
assert ~W(Hello #{1+1}) == ["Hello", ___]
|
assert ~W(Hello #{1+1}) == ___
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ defmodule SigilsTests do
|
|||||||
true,
|
true,
|
||||||
"1 + 1 = 2",
|
"1 + 1 = 2",
|
||||||
~S(1 + 1 = #{1+1}),
|
~S(1 + 1 = #{1+1}),
|
||||||
{:multiple, ["Hello", "world"]},
|
["Hello", "world"],
|
||||||
{:multiple, ["Hello", "123"]},
|
["Hello", "123"],
|
||||||
~S(#{1+1}),
|
["Hello", ~S(#{1+1})],
|
||||||
]
|
]
|
||||||
|
|
||||||
test_all(Sigils, answers)
|
test_all(Sigils, answers)
|
||||||
|
|||||||
Reference in New Issue
Block a user