27 lines
503 B
Go
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)
|
|
}
|