Skip to content

Commit

Permalink
Who is amazing enough to encode a typo into all the tests?
Browse files Browse the repository at this point in the history
THIS GUY!
  • Loading branch information
PragTob committed Jan 12, 2025
1 parent 4c7bf09 commit 445ef11
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ iex> Statistex.average(samples, sample_size: 10)
# It is recommended that you manually handle the empty list case should that occur as your
# output is likely also very different from when you have statistics.
iex> Statistex.statistics([])
** (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.
```

## Supported Statistics
Expand Down
22 changes: 11 additions & 11 deletions lib/statistex.ex
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ defmodule Statistex do
}
iex> Statistex.statistics([])
** (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> Statistex.statistics([0, 0, 0, 0])
%Statistex{
Expand Down Expand Up @@ -189,7 +189,7 @@ defmodule Statistex do
0
iex> Statistex.total([])
** (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.
"""
@spec total(samples) :: number
def total([]), do: raise(ArgumentError, @empty_list_error_message)
Expand Down Expand Up @@ -243,7 +243,7 @@ defmodule Statistex do
20.0
iex> Statistex.average([])
** (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.
"""
@spec average(samples, keyword) :: float
def average(samples, options \\ [])
Expand Down Expand Up @@ -281,7 +281,7 @@ defmodule Statistex do
0.0
iex> Statistex.variance([])
** (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.
"""
@spec variance(samples, keyword) :: float
def variance(samples, options \\ [])
Expand Down Expand Up @@ -332,7 +332,7 @@ defmodule Statistex do
0.0
iex> Statistex.standard_deviation([])
** (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.
"""
@spec standard_deviation(samples, keyword) :: float
def standard_deviation(samples, options \\ [])
Expand Down Expand Up @@ -370,7 +370,7 @@ defmodule Statistex do
0.4
iex> Statistex.standard_deviation_ratio([])
** (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.
"""
@spec standard_deviation_ratio(samples, keyword) :: float
def standard_deviation_ratio(samples, options \\ [])
Expand Down Expand Up @@ -443,7 +443,7 @@ defmodule Statistex do
** (ArgumentError) percentile must be between 0 and 100, got: 0
iex> Statistex.percentiles([], [50])
** (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.
"""
@spec percentiles(samples, number | [number(), ...]) ::
percentiles()
Expand All @@ -468,7 +468,7 @@ defmodule Statistex do
}
iex> Statistex.frequency_distribution([])
** (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.
"""
@spec frequency_distribution(samples) :: %{required(sample) => pos_integer}
def frequency_distribution([]), do: raise(ArgumentError, @empty_list_error_message)
Expand Down Expand Up @@ -533,7 +533,7 @@ defmodule Statistex do
0.0
iex> Statistex.median([])
** (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.
"""
@spec median(samples, keyword) :: number
def median(samples, options \\ [])
Expand All @@ -559,7 +559,7 @@ defmodule Statistex do
100
iex> Statistex.maximum([])
** (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.
"""
@spec maximum(samples) :: sample
def maximum([]), do: raise(ArgumentError, @empty_list_error_message)
Expand All @@ -576,7 +576,7 @@ defmodule Statistex do
1
iex> Statistex.minimum([])
** (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.
"""
@spec minimum(samples) :: sample
def minimum([]), do: raise(ArgumentError, @empty_list_error_message)
Expand Down
2 changes: 1 addition & 1 deletion lib/statistex/percentile.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule Statistex.Percentile do
def percentiles([], _) 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 445ef11

Please sign in to comment.