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