stat: explicitly panic when calling CDF with empty x

This commit is contained in:
Dan Kortschak
2021-05-21 17:50:37 +09:30
parent 87c72c1b85
commit 571f6ffe3c
2 changed files with 14 additions and 0 deletions

View File

@@ -1396,6 +1396,16 @@ func TestCDF(t *testing.T) {
x []float64
weights []float64
}{
{
name: "x == nil",
kind: Empirical,
x: nil,
},
{
name: "len(x) == 0",
kind: Empirical,
x: []float64{},
},
{
name: "len(x) != len(weights)",
q: 1.5,