Use triple underscore instead of double

This commit is contained in:
Uku Taht
2016-04-20 11:23:44 +01:00
parent ea2bb8f9bf
commit ded0f11ec6
16 changed files with 148 additions and 161 deletions

View File

@@ -2,38 +2,38 @@ defmodule Strings do
use Koans
koan "Strings are there to represent text" do
assert "hello" == __
assert "hello" == ___
end
koan "They can be put together" do
assert "hello world" == __ <> "world"
assert "hello world" == ___ <> "world"
end
koan "Or pulled apart when needed" do
assert __ == String.split("hello world")
assert ___ == String.split("hello world")
end
koan "Be careful, a message may be altered" do
assert __ == String.replace("An awful day", "awful", "incredible")
assert ___ == String.replace("An awful day", "awful", "incredible")
end
koan "But strings never lie about themselves" do
assert true == String.contains?("An incredible day", __)
assert true == String.contains?("An incredible day", ___)
end
koan "Sometimes you want just the opposite of what is given" do
assert __ == String.reverse("ananab")
assert ___ == String.reverse("ananab")
end
koan "Other times a little cleaning is in order" do
assert __ == String.strip(" \n banana\n ")
assert ___ == String.strip(" \n banana\n ")
end
koan "Repetition is the mother of learning" do
assert "StringStringString" == String.duplicate(__, 3)
assert "StringStringString" == String.duplicate(___, 3)
end
koan "Strings can be louder when necessary" do
assert "LISTEN" == String.upcase(__)
assert "LISTEN" == String.upcase(___)
end
end