Add test for chi2 panic

This commit is contained in:
Jonathan J Lawlor
2014-10-19 18:37:14 -04:00
parent 5d7e4d3b79
commit b77ecc2c2d

View File

@@ -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.