math-optim/algo/util_test.go
surtur c8ed8eb82b
All checks were successful
continuous-integration/drone/push Build is passing
go(util_test.go): use more sensible error message
2022-06-29 17:02:13 +02:00

40 lines
842 B
Go

// Copyright 2022 wanderer <a_mirre at utb dot cz>
// SPDX-License-Identifier: GPL-3.0-or-later
package algo
import (
"os"
"testing"
)
// nolint: ifshort
func TestCreateFolder(t *testing.T) {
// let's assume this will never exist in a clean project...
testPath := "whatever-path"
got := createFolder(testPath)
var want error
if want != got {
t.Errorf("issue creating folder, testPath: %q, full cmd: %q", testPath, got.Error())
}
os.RemoveAll(testPath)
}
// nolint: ifshort
func TestCreatePath(t *testing.T) {
// let's assume this, too, will never exist in a clean project...
testPath := "whatever-path/whatever-subpath/subsubpath"
got := createPath(testPath)
var want error
if want != got {
t.Errorf("issue creating folders in path, testPath: %q, full cmd: %q", testPath, got.Error())
}
os.RemoveAll(testPath)
}