Add test for JensenShannon panic

Add test when p and q have different lengths.
This commit is contained in:
Jonathan J Lawlor
2014-10-30 22:36:36 -04:00
parent f7a24e5044
commit 9c9aa85f27

View File

@@ -496,6 +496,9 @@ func TestJensenShannon(t *testing.T) {
t.Errorf("JS mismatch case %v. Expected %v, found %v.", i, js1, js2)
}
}
if !Panics(func() { JensenShannon(make([]float64, 3), make([]float64, 2)) }) {
t.Errorf("JensenShannon did not panic with p, q length mismatch")
}
}
func TestKolmogorovSmirnov(t *testing.T) {