34 lines
563 B
Go
34 lines
563 B
Go
|
// +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
|
||
|
}
|