summaryrefslogtreecommitdiff
path: root/cache
diff options
context:
space:
mode:
authorewy <ewy0@protonmail.com>2026-05-17 01:56:44 +0200
committerewy <ewy0@protonmail.com>2026-05-17 01:58:20 +0200
commitbcc71c92fd6f24cad75b713b6de0da8989c48b70 (patch)
treef541634b57295d4bf216bce7359142708d42ac8b /cache
parentf5807d9f3a6c96e70912b61fac17120f412b5782 (diff)
fix existing tests and import loop
Diffstat (limited to 'cache')
-rw-r--r--cache/cache_test.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/cache/cache_test.go b/cache/cache_test.go
index d2792ca..204f670 100644
--- a/cache/cache_test.go
+++ b/cache/cache_test.go
@@ -210,16 +210,17 @@ func TestMergeNilNormal(t *testing.T) {
func TestCacheInit_Init(t *testing.T) {
d := t.TempDir()
paths.SetAll(d)
+ defer paths.Reset()
c := &cacheInit{}
err := c.Init()
assert.NoError(t, err)
- assert.Contains(t, paths.ContextsFile, d)
+ assert.Contains(t, paths.ContextsFile.String(), d)
}
func TestInsert(t *testing.T) {
d := t.TempDir()
st := TState(TSource("source", "target"))
- paths.SetAll(d)
+ paths.Set(paths.CacheDir, d)
defer paths.Reset()
err := MergeAndSave(st)
assert.NoError(t, err)
@@ -228,6 +229,7 @@ func TestInsert(t *testing.T) {
func TestInsertNonExistent(t *testing.T) {
st := TState(TSource("source", "target"))
paths.SetAll("/../")
+ defer paths.Reset()
err := MergeAndSave(st)
assert.Error(t, err)
}