2022-01-19 00:03:24 +00:00
|
|
|
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)
|
2022-01-19 02:10:50 +00:00
|
|
|
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)
|
2022-01-19 00:03:24 +00:00
|
|
|
}
|