Torjus Håkestad
150ffc3400
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
30 lines
581 B
Go
30 lines
581 B
Go
package files_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.t-juice.club/torjus/gpaste/files"
|
|
)
|
|
|
|
func TestFSFileStore(t *testing.T) {
|
|
newFunc := func() files.FileStore {
|
|
dir := t.TempDir()
|
|
s, err := files.NewFSFileStore(dir)
|
|
if err != nil {
|
|
t.Fatalf("Error creating store: %s", err)
|
|
}
|
|
return s
|
|
}
|
|
|
|
RunFilestoreTest(newFunc, t)
|
|
persistentDir := t.TempDir()
|
|
persistentFunc := func() files.FileStore {
|
|
s, err := files.NewFSFileStore(persistentDir)
|
|
if err != nil {
|
|
t.Fatalf("Error creating store: %s", err)
|
|
}
|
|
return s
|
|
}
|
|
RunPersistentFilestoreTest(persistentFunc, t)
|
|
}
|