mirror of
https://github.com/apple/pkl.git
synced 2026-05-25 16:19:20 +02:00
Fix import/read verification when encountering glob wildcards (#1559)
Fixes an issue where the import verifier can possibly throw when packaging on Windows due to `*` being an invalid filename.
This commit is contained in:
@@ -763,6 +763,43 @@ class CliProjectPackagerTest {
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `import path verification with glob imports`(@TempDir tempDir: Path) {
|
||||
tempDir.writeFile(
|
||||
"main.pkl",
|
||||
"""
|
||||
import* "**.pkl" as foo
|
||||
|
||||
res = foo
|
||||
"""
|
||||
.trimIndent(),
|
||||
)
|
||||
tempDir.writeFile(
|
||||
"PklProject",
|
||||
"""
|
||||
amends "pkl:Project"
|
||||
|
||||
package {
|
||||
name = "mypackage"
|
||||
version = "1.0.0"
|
||||
baseUri = "package://example.com/mypackage"
|
||||
packageZipUrl = "https://foo.com"
|
||||
}
|
||||
"""
|
||||
.trimIndent(),
|
||||
)
|
||||
|
||||
CliProjectPackager(
|
||||
CliBaseOptions(workingDir = tempDir),
|
||||
listOf(tempDir),
|
||||
CliTestOptions(),
|
||||
".out/%{name}@%{version}",
|
||||
skipPublishCheck = true,
|
||||
consoleWriter = StringWriter(),
|
||||
)
|
||||
.run()
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisabledOnOs(OS.WINDOWS)
|
||||
fun `import path verification -- absolute read from root dir`(@TempDir tempDir: Path) {
|
||||
|
||||
Reference in New Issue
Block a user