Skip to content

Commit 20e720d

Browse files
committed
New property: shuffling the samples doesn't change the result
1 parent 0d6bdbe commit 20e720d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/statistex_test.exs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ defmodule Statistex.StatistexTest do
165165
assert_basic_statistics(stats)
166166
assert_mode_in_samples(stats, samples)
167167
frequency_assertions(stats, samples)
168+
169+
# shuffling values around shouldn't change the results
170+
shuffled_stats = samples |> Enum.shuffle() |> statistics()
171+
assert stats == shuffled_stats
168172
end
169173

170174
defp assert_basic_statistics(stats) do

0 commit comments

Comments
 (0)