gpaste/userstore_bolt_test.go

28 lines
479 B
Go
Raw Normal View History

2022-01-19 20:45:53 +00:00
package gpaste_test
import (
"path/filepath"
"testing"
"git.t-juice.club/torjus/gpaste"
)
func TestBoltUserStore(t *testing.T) {
tmpDir := t.TempDir()
newFunc := func() (func(), gpaste.UserStore) {
tmpFile := filepath.Join(tmpDir, randomString(8))
store, err := gpaste.NewBoltUserStore(tmpFile)
if err != nil {
t.Fatalf("Error creating store: %s", err)
}
cleanup := func() {
store.Close()
}
return cleanup, store
}
RunUserStoreTest(newFunc, t)
}