sarafu-vise/testutil/gdbmdb.go

34 lines
563 B
Go
Raw Normal View History

2025-01-21 16:02:32 +01:00
// +build testgdbmdb
package testutil
import (
"os"
"net/url"
)
const (
testDbCookie = true
)
func init() {
stateDir, err := os.MkdirTemp("", "sarafu-vise-menutraversal-gdbm-state-")
if err != nil {
panic(err)
}
stateDir, err = url.JoinPath("gdbm:///", stateDir)
if err != nil {
panic(err)
}
override.StateConn = &stateDir
userDir, err := os.MkdirTemp("", "sarafu-vise-menutraversal-gdbm-user-")
if err != nil {
panic(err)
}
userDir, err = url.JoinPath("gdbm:///", userDir)
if err != nil {
panic(err)
}
override.UserConn = &userDir
}