cec2020: add more tests
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
54b4ec536a
commit
018cf070c3
@ -48,3 +48,36 @@ func TestGriewank(t *testing.T) {
|
|||||||
t.Errorf("unexpected result from Griewank, want: %f, got: %v", want, got)
|
t.Errorf("unexpected result from Griewank, want: %f, got: %v", want, got)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestHybrid1(t *testing.T) {
|
||||||
|
in := []float64{-9.2, 10, .7, 3, -80.2843}
|
||||||
|
want := 0.00025455132345086895
|
||||||
|
|
||||||
|
got := Hybrid1(in)
|
||||||
|
|
||||||
|
if got != want {
|
||||||
|
t.Errorf("unexpected result from Hybrid1, want: %f, got: %v", want, got)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestHybrid2(t *testing.T) {
|
||||||
|
in := []float64{-9.2, 10, .7, 3, -80.2843}
|
||||||
|
want := 25.298615746321026
|
||||||
|
|
||||||
|
got := Hybrid2(in)
|
||||||
|
|
||||||
|
if got != want {
|
||||||
|
t.Errorf("unexpected result from Hybrid2, want: %f, got: %v", want, got)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestHybrid3(t *testing.T) {
|
||||||
|
in := []float64{-9.2, 10, .7, 3, -80.2843}
|
||||||
|
want := 16.298615746321026
|
||||||
|
|
||||||
|
got := Hybrid3(in)
|
||||||
|
|
||||||
|
if got != want {
|
||||||
|
t.Errorf("unexpected result from Hybrid3, want: %f, got: %v", want, got)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user