go(stats): add table_test.go
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
4abc9e6246
commit
58edf3c506
29
stats/table_test.go
Normal file
29
stats/table_test.go
Normal 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")
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user