mirror of
https://github.com/anchore/syft.git
synced 2026-10-31 06:26:30 +01:00
fix: separate golang license caches from mod dir (#2852)
Signed-off-by: Keith Zantow <kzantow@gmail.com>
This commit is contained in:
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
package cache
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func Test_SetManager(t *testing.T) {
|
||||
original := GetManager()
|
||||
defer SetManager(original)
|
||||
|
||||
SetManager(NewInMemory(0))
|
||||
|
||||
require.NotNil(t, GetManager())
|
||||
require.IsType(t, &filesystemCache{}, GetManager())
|
||||
|
||||
SetManager(nil)
|
||||
require.NotNil(t, GetManager())
|
||||
require.IsType(t, &bypassedCache{}, GetManager())
|
||||
}
|
||||
Reference in New Issue
Block a user