working on valuemonitor

This commit is contained in:
2026-08-17 09:49:50 -04:00
parent 5083d3911b
commit 3d14359832
5 changed files with 377 additions and 14 deletions
+27
View File
@@ -0,0 +1,27 @@
package settings
import (
"errors"
"os"
"testing"
)
const (
TheTestFilename = "settings_test.settings"
)
func TestMain(m *testing.M) {
exitCode := func() int {
if err := os.Remove(TheTestFilename); err != nil && !errors.Is(err, os.ErrNotExist) {
panic("error cleaning up " + TheTestFilename + " from previous run: " + err.Error())
} else if err := os.WriteFile(TheTestFilename, nil, 0664); err != nil {
panic("error creating empty " + TheTestFilename + ": " + err.Error())
}
defer os.Remove(TheTestFilename)
TheSettings = NewSettings(TheTestFilename, false)
return m.Run()
}()
os.Exit(exitCode)
}