go(stats): add table_test.go
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-06-27 21:10:33 +02:00
parent 4abc9e6246
commit 58edf3c506
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

29
stats/table_test.go Normal file
View File

@ -0,0 +1,29 @@
// Copyright 2022 wanderer <a_mirre at utb dot cz>
// SPDX-License-Identifier: GPL-3.0-or-later
package stats
import (
"testing"
)
func TestMakeTableHdr(t *testing.T) {
want := statsHdr{
Algo: "Random Search",
BenchFuncName: "Schwefel",
Dimens: 10,
Generations: 3000,
Iterations: 30,
}
got := makeTableHdr("Random Search", "Schwefel", 10, 3000, 30)
if want != got {
t.Errorf("wrong hdr, want: %v, got: %v", want, got)
}
}
func TestNewStatsHdr(t *testing.T) {
if want := newStatsHdr(); want == nil {
t.Error("could not create hdr")
}
}