From b77ecc2c2de8fa6ea1b4a1baf7b48c83327b2955 Mon Sep 17 00:00:00 2001 From: Jonathan J Lawlor Date: Sun, 19 Oct 2014 18:37:14 -0400 Subject: [PATCH] Add test for chi2 panic --- stat_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stat_test.go b/stat_test.go index 903dcc61..3079e333 100644 --- a/stat_test.go +++ b/stat_test.go @@ -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.