Reduce needless repetition
This commit is contained in:
@@ -25,7 +25,7 @@ defmodule Functions do
|
|||||||
assert first("One") == ___
|
assert first("One") == ___
|
||||||
end
|
end
|
||||||
|
|
||||||
def repeat_again(message, times \\ 5) do
|
def repeat_again(message, times \\ 3) do
|
||||||
String.duplicate(message, times)
|
String.duplicate(message, times)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ defmodule FunctionsTests do
|
|||||||
"Hello, World!",
|
"Hello, World!",
|
||||||
3,
|
3,
|
||||||
{:multiple, ["One and Two", "Only One"]},
|
{:multiple, ["One and Two", "Only One"]},
|
||||||
{:multiple, ["Hello Hello Hello Hello Hello ", "Hello Hello "]},
|
{:multiple, ["Hello Hello Hello ", "Hello Hello "]},
|
||||||
{:multiple, [:entire_list, :single_thing]},
|
{:multiple, [:entire_list, :single_thing]},
|
||||||
{:multiple, ["10 is bigger than 5", "4 is not bigger than 27"]},
|
{:multiple, ["10 is bigger than 5", "4 is not bigger than 27"]},
|
||||||
{:multiple, ["The number was zero", "The number was 5"]},
|
{:multiple, ["The number was zero", "The number was 5"]},
|
||||||
|
|||||||
Reference in New Issue
Block a user