Skip to content

Commit

Permalink
Hopefully fix windows support
Browse files Browse the repository at this point in the history
  • Loading branch information
HT154 committed Oct 17, 2024
1 parent 0a2c4d6 commit 02d193e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions pkl-cli/src/test/kotlin/org/pkl/cli/CliEvaluatorTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1459,19 +1459,20 @@ result = someLib.x

@Test
fun `eval file with non-ASCII name`() {
val tempDirUri = tempDir.toUri()
val dir = tempDir.resolve("🤬").createDirectory()
val file = writePklFile(dir.resolve("日本語.pkl").toString(), """
日本語 = "Japanese language"
readDir = read(".").text
readDirFile = read("file:$tempDir/🤬").text
readDirFile = read("$tempDirUri🤬").text
readOne = read("日本語.pkl").text.split("\n").first
readOneFile = read("file:$tempDir/🤬/日本語.pkl").text.split("\n").first
readOneFile = read("$tempDirUri🤬/日本語.pkl").text.split("\n").first
readGlob = read*("./日*.pkl").keys
readGlobFile = read*("file:$tempDir/**/*.pkl").keys.map((it) -> it.replaceAll("$tempDir", ""))
readGlobFile = read*("$tempDirUri**/*.pkl").keys.map((it) -> it.replaceAll("$tempDirUri".replaceAll("///", "/"), ""))
importOne = import("日本語.pkl").readOne
importOneFile = import("file:$tempDir/🤬/日本語.pkl").日本語
importOneFile = import("$tempDirUri🤬/日本語.pkl").日本語
importGlob = import*("./日*.pkl").keys
importGlobFile = import*("file:$tempDir/**/*.pkl").keys.map((it) -> it.replaceAll("$tempDir", ""))
importGlobFile = import*("$tempDirUri**/*.pkl").keys.map((it) -> it.replaceAll("$tempDirUri".replaceAll("///", "/"), ""))
""".trimIndent())
val output =
evalToConsole(
Expand All @@ -1492,11 +1493,11 @@ readDirFile = ""${'"'}
readOne = "日本語 = \"Japanese language\""
readOneFile = "日本語 = \"Japanese language\""
readGlob = Set("./日本語.pkl")
readGlobFile = Set("file:/🤬/日本語.pkl")
readGlobFile = Set("🤬/日本語.pkl")
importOne = "日本語 = \"Japanese language\""
importOneFile = "Japanese language"
importGlob = Set("./日本語.pkl")
importGlobFile = Set("file:/🤬/日本語.pkl")
importGlobFile = Set("🤬/日本語.pkl")
""")
}

Expand Down

0 comments on commit 02d193e

Please sign in to comment.