Resolve producer modes turn allowances cache controls and shared workers
This commit is contained in:
21
internal/core/config/cache_test.go
Normal file
21
internal/core/config/cache_test.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestDefaultCacheRootUsesOneApplicationDirectory(t *testing.T) {
|
||||
root, err := DefaultCacheRoot(func() (string, error) { return "/tmp/user-cache", nil })
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if root != filepath.Join("/tmp/user-cache", "notarius") {
|
||||
t.Fatalf("root = %q", root)
|
||||
}
|
||||
failure := errors.New("cache home unavailable")
|
||||
if _, err := DefaultCacheRoot(func() (string, error) { return "", failure }); !errors.Is(err, failure) {
|
||||
t.Fatalf("lost cache discovery error: %v", err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user