Skip to content

Commit

Permalink
typo fix and missing test case
Browse files Browse the repository at this point in the history
  • Loading branch information
PragTob committed Nov 9, 2023
1 parent fb9f5ca commit 0f6937e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/statistex.ex
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,12 @@ defmodule Statistex do
iex> Statistex.mode([1, 2, 3, 4, 5])
nil
# When a measurement failed and nils is reported as the only value
iex> Statistex.mode([nil])
nil
iex> Statistex.mode([])
** (ArgumentError) Passed an empty list ([]) to calculate statistics from, please pass a list containing at least on number.
** (ArgumentError) Passed an empty list ([]) to calculate statistics from, please pass a list containing at least one number.
iex> mode = Statistex.mode([5, 3, 4, 5, 1, 3, 1])
iex> Enum.sort(mode)
Expand Down
2 changes: 1 addition & 1 deletion lib/statistex/mode.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule Statistex.Mode do
def mode([], _) do
raise(
ArgumentError,
"Passed an empty list ([]) to calculate statistics from, please pass a list containing at least on number."
"Passed an empty list ([]) to calculate statistics from, please pass a list containing at least one number."
)
end

Expand Down

0 comments on commit 0f6937e

Please sign in to comment.