math-optim/algo/algo_test.go
surtur 7b22723cb0
All checks were successful
continuous-integration/drone/push Build is passing
go: standardise output dirs for reporting material
2022-07-12 16:56:49 +02:00

49 lines
728 B
Go

// Copyright 2022 wanderer <a_mirre at utb dot cz>
// SPDX-License-Identifier: GPL-3.0-or-later
package algo
import (
"os"
"sync"
"testing"
"git.dotya.ml/wanderer/math-optim/report"
)
var wg sync.WaitGroup
func TestDoRandomSearchExec(t *testing.T) {
wg.Add(1)
go DoRandomSearch(&wg)
wg.Wait()
picsDir := report.GetPicsDir()
if err := os.RemoveAll(picsDir); err != nil {
t.Error(err)
}
}
func TestDoSHCExec(t *testing.T) {
wg.Add(1)
go DoStochasticHillClimbing(&wg)
wg.Wait()
picsDir := report.GetPicsDir()
if err := os.RemoveAll(picsDir); err != nil {
t.Error(err)
}
}
func TestNewValues(t *testing.T) {
if v := newValues(); v == nil {
t.Error("failed to get values from newValues()")
}
}