Skip to content

Commit 93620e7

Browse files
committed
Undo changes having the tests expect the input list is ordered
I think that's a dangerous assumption and our code should be resilient to it :)
1 parent e5edbb6 commit 93620e7

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

test/statistex/percentile_test.exs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ defmodule Statistex.PercentileTest do
44

55
doctest Statistex.Percentile
66

7-
@nist_sample_data Enum.sort([
8-
95.1772,
9-
95.1567,
10-
95.1937,
11-
95.1959,
12-
95.1442,
13-
95.0610,
14-
95.1591,
15-
95.1195,
16-
95.1065,
17-
95.0925,
18-
95.1990,
19-
95.1682
20-
])
7+
@nist_sample_data [
8+
95.1772,
9+
95.1567,
10+
95.1937,
11+
95.1959,
12+
95.1442,
13+
95.0610,
14+
95.1591,
15+
95.1195,
16+
95.1065,
17+
95.0925,
18+
95.1990,
19+
95.1682
20+
]
2121

2222
# Test data from:
2323
# http://www.itl.nist.gov/div898/handbook/prc/section2/prc262.htm
@@ -49,7 +49,7 @@ defmodule Statistex.PercentileTest do
4949
end
5050

5151
describe "a list of two elements" do
52-
@samples [200, 300]
52+
@samples [300, 200]
5353
test "1st percentile (small sample size simply picks first element)" do
5454
%{1 => result} = percentiles(@samples, [1])
5555
assert result == 200.0
@@ -67,7 +67,7 @@ defmodule Statistex.PercentileTest do
6767
end
6868

6969
describe "seemingly problematic 2 element list [9, 1]" do
70-
@samples [1, 9]
70+
@samples [9, 1]
7171

7272
percentiles = %{
7373
25 => 1,
@@ -88,7 +88,7 @@ defmodule Statistex.PercentileTest do
8888
end
8989

9090
describe "a list of three elements" do
91-
@samples [100, 200, 300]
91+
@samples [100, 300, 200]
9292
test "1st percentile (small sample size simply picks first element)" do
9393
%{1 => result} = percentiles(@samples, [1])
9494
assert result == 100.0

0 commit comments

Comments
 (0)