1 // Copyright (C) The Lightning Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
13 type pvalueSuite struct{}
15 var _ = check.Suite(&pvalueSuite{})
17 func (s *pvalueSuite) TestPvalue(c *check.C) {
20 for i := 0; i < 25; i++ {
24 for i := 25; i < 31; i++ {
27 for i := 31; i < 40; i++ {
30 c.Check(fmt.Sprintf("%.8f", pvalue(a, b)), check.Equals, "0.04147853")
34 for i := 0; i < 25; i++ {
38 c.Check(fmt.Sprintf("%.9f", pvalue(a, b)), check.Equals, "0.000000072")
42 c.Check(fmt.Sprintf("%.9f", pvalue(a, b)), check.Equals, "0.000000573")
44 a = []bool{true, true, true, false, true, false, false, false}
45 b = []bool{true, true, true, true, false, false, false, false}
46 c.Check(fmt.Sprintf("%.8f", pvalue(a, b)), check.Equals, "0.31731051")
50 c.Check(fmt.Sprintf("%.8f", pvalue(a, b)), check.Equals, "0.31731051")