From 018cf070c3824ca795f464fbb1bdb5086c9c3098 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 9 Feb 2023 23:45:04 +0100 Subject: [PATCH] cec2020: add more tests --- bench/cec2020/benchFunctions_test.go | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/bench/cec2020/benchFunctions_test.go b/bench/cec2020/benchFunctions_test.go index 2f474e5..5f1e6b8 100644 --- a/bench/cec2020/benchFunctions_test.go +++ b/bench/cec2020/benchFunctions_test.go @@ -48,3 +48,36 @@ func TestGriewank(t *testing.T) { 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) + } +}