Skip to content

Commit 3e3aa50

Browse files
committed
Set global cache in ZipAndJarFileLookupFactoryTest
1 parent 395d1f7 commit 3e3aa50

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/test/dotty/tools/dotc/classpath/ZipAndJarFileLookupFactoryTest.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import org.junit.Test
66
import java.nio.file._
77
import java.nio.file.attribute.FileTime
88

9+
import dotty.tools.dotc.GlobalCache
910
import dotty.tools.dotc.core.Contexts.{Context, ContextBase, ctx}
1011
import dotty.tools.io.AbstractFile
1112

@@ -18,7 +19,9 @@ class ZipAndJarFileLookupFactoryTest {
1819
val f = Files.createTempFile("test-", ".jar")
1920
Files.delete(f)
2021

21-
given Context = new ContextBase().initialCtx
22+
val freshContext = new ContextBase().initialCtx.fresh
23+
freshContext.setGlobalCache(GlobalCache())
24+
given Context = freshContext
2225
assert(!ctx.settings.YdisableFlatCpCaching.value) // we're testing with our JAR metadata caching enabled.
2326

2427
def createCp = ZipAndJarClassPathFactory.create(AbstractFile.getFile(f))

0 commit comments

Comments
 (0)