Add tests for cross entropy's panic

This commit is contained in:
Jonathan J Lawlor
2014-10-19 22:00:15 -04:00
parent 19f7ba742a
commit 8669c5e165

View File

@@ -193,6 +193,10 @@ func TestCrossEntropy(t *testing.T) {
t.Errorf("Cross entropy mismatch case %d: Expected %v, Found %v", i, test.ans, c)
}
}
if !Panics(func() { CrossEntropy(make([]float64, 3), make([]float64, 2)) }) {
t.Errorf("CrossEntropy did not panic with p, q length mismatch")
}
}
func ExampleEntropy() {