Skip to content

Commit

Permalink
扩充 CalculateCurveCorrelation 测试用例
Browse files Browse the repository at this point in the history
Signed-off-by: allan716 <525223688@qq.com>
  • Loading branch information
allanpk716 committed Nov 8, 2021
1 parent 5db8c3e commit b2ec5a0
Showing 1 changed file with 30 additions and 0 deletions.
Expand Up @@ -56,6 +56,36 @@ func TestCalculateCurveCorrelation(t *testing.T) {
n: 30,
},
want: -1},
{name: "03", args: args{
s1: []float64{0.309016989, 0.587785244, 0.809016985, 0.95105651, 1, 0.951056526,
0.809017016, 0.587785287, 0.30901704, 5.35898e-08, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0},
s2: []float64{0, 0, 0.187381311, 0.368124547, 0.535826787,
0.684547097, 0.809016985, 0.904827044, 0.968583156, 0.998026727,
0.992114705, 0.951056526, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0},
n: 30,
},
want: 0.4024278361610972},
{name: "03", args: args{
s1: []float64{0.309016989, 0.587785244, 0.809016985, 0.95105651, 1, 0.951056526,
0.809017016, 0.587785287, 0.30901704, 5.35898e-08, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0},
s2: []float64{0.187381311, 0.368124547, 0.535826787, 0.684547097, 0.809016985,
0.904827044, 0.968583156, 0.998026727, 0.992114705, 0.951056526,
0.876306697, 0.770513267, 0.637424022, 0.481753714, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0},
n: 30,
},
want: 0.6126176272432471},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit b2ec5a0

Please sign in to comment.