gpaste/filestore_fs_test.go
Torjus Håkestad 9449b37ab1
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Add test for persistance to store
2022-01-19 03:10:50 +01:00

27 lines
503 B
Go

package gpaste_test
import (
"testing"
"git.t-juice.club/torjus/gpaste"
)
func TestFSFileStore(t *testing.T) {
dir := t.TempDir()
s, err := gpaste.NewFSFileStore(dir)
if err != nil {
t.Fatalf("Error creating store: %s", err)
}
RunFilestoreTest(s, t)
persistentDir := t.TempDir()
newFunc := func() gpaste.FileStore {
s, err := gpaste.NewFSFileStore(persistentDir)
if err != nil {
t.Fatalf("Error creating store: %s", err)
}
return s
}
RunPersistentFilestoreTest(newFunc, t)
}