Add test for panic in Bhattacharyya

This commit is contained in:
Jonathan J Lawlor
2014-10-19 17:09:43 -04:00
parent 013f164022
commit e5c3361454

View File

@@ -623,6 +623,11 @@ func TestBhattacharyya(t *testing.T) {
t.Errorf("Bhattacharyya distance is assymmetric in case %d.", i)
}
}
// Bhattacharyya should panic if the inputs have different length
if !Panics(func() { Bhattacharyya(make([]float64, 2), make([]float64, 3)) }) {
t.Errorf("Bhattacharyya did not panic with length mismatch")
}
}
func TestHellinger(t *testing.T) {