mirror of
https://github.com/apple/pkl.git
synced 2026-03-31 14:13:15 +02:00
Encode filepaths to be safe on Windows
This changes the file paths to use characters that are safe for Windows. Channges the output of the following: * Package cache directory * Generated pkl-doc files * Kotlin generated code Unsafe characters are encoded as (<hex>). For example, the colon character `:` is encoded as `(3a)`. Additionally, this changes the cache directory prefix (package-1 to package-2). Follows the design of https://github.com/apple/pkl-evolution/pull/3
This commit is contained in:
@@ -2,8 +2,11 @@ package org.pkl.executor
|
||||
|
||||
import org.assertj.core.api.Assertions.assertThat
|
||||
import org.junit.jupiter.api.AfterAll
|
||||
import org.junit.jupiter.api.Disabled
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.api.assertThrows
|
||||
import org.junit.jupiter.api.condition.DisabledOnOs
|
||||
import org.junit.jupiter.api.condition.OS
|
||||
import org.junit.jupiter.api.io.TempDir
|
||||
import org.junit.jupiter.params.ParameterizedTest
|
||||
import org.junit.jupiter.params.provider.MethodSource
|
||||
@@ -424,9 +427,11 @@ class EmbeddedExecutorTest {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("getAllTestExecutors")
|
||||
@DisabledOnOs(OS.WINDOWS, disabledReason = "Can't populate legacy cache dir on Windows")
|
||||
fun `evaluate a project dependency`(executor: TestExecutor, @TempDir tempDir: Path) {
|
||||
val cacheDir = tempDir.resolve("packages")
|
||||
PackageServer.populateCacheDir(cacheDir)
|
||||
PackageServer.populateLegacyCacheDir(cacheDir)
|
||||
val projectDir = tempDir.resolve("project/")
|
||||
projectDir.createDirectories()
|
||||
projectDir.resolve("PklProject").toFile().writeText("""
|
||||
|
||||
Reference in New Issue
Block a user