mirror of
https://github.com/gonum/gonum.git
synced 2025-10-20 13:55:20 +08:00
Add test for chi2 panic
This commit is contained in:
@@ -582,6 +582,9 @@ func TestChiSquare(t *testing.T) {
|
||||
t.Errorf("ChiSquare distance mismatch in case %d. Expected %v, Found %v", i, test.res, resultpq)
|
||||
}
|
||||
}
|
||||
if !Panics(func() { ChiSquare(make([]float64, 2), make([]float64, 3)) }) {
|
||||
t.Errorf("ChiSquare did not panic with length mismatch")
|
||||
}
|
||||
}
|
||||
|
||||
// Panics returns true if the called function panics during evaluation.
|
||||
|
Reference in New Issue
Block a user