mirror of
https://github.com/apple/pkl.git
synced 2026-05-25 16:19:20 +02:00
Fix parsing of dependency notation URIs (#1570)
Fixes a thrown exception when path segments contain characters that aren't URI safe (e.g. `import "@foo/bar baz.pkl"`). Closes #1545
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
amends "pkl:Project"
|
||||
|
||||
package {
|
||||
name = "packageWithSpaces"
|
||||
baseUri = "package://localhost:0/packageWithSpaces"
|
||||
version = "1.0.0"
|
||||
packageZipUrl = "https://localhost:0/packageWithSpaces/packageWithSpaces-\(version).zip"
|
||||
}
|
||||
pkl-core/src/test/files/LanguageSnippetTests/input/projects/packageWithSpaces/module with spaces.pkl
Vendored
+1
@@ -0,0 +1 @@
|
||||
foo = 1
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
amends "pkl:Project"
|
||||
|
||||
dependencies {
|
||||
["birds"] {
|
||||
uri = "package://localhost:0/birds@0.7.0"
|
||||
}
|
||||
["packageWithSpaces"] = import("../packageWithSpaces/PklProject")
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"resolvedDependencies": {
|
||||
"package://localhost:0/birds@0": {
|
||||
"type": "remote",
|
||||
"uri": "projectpackage://localhost:0/birds@0.7.0",
|
||||
"checksums": {
|
||||
"sha256": "$skipChecksumVerification"
|
||||
}
|
||||
},
|
||||
"package://localhost:0/packageWithSpaces@1": {
|
||||
"type": "local",
|
||||
"uri": "projectpackage://localhost:0/packageWithSpaces@1.0.0",
|
||||
"path": "../packageWithSpaces/"
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import* "@birds/catalog/{Ostrich,Swallow}.pkl" as myCatalog
|
||||
|
||||
res = myCatalog.keys
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import "@packageWithSpaces/module with spaces.pkl" as mod
|
||||
|
||||
res = mod
|
||||
+1
@@ -0,0 +1 @@
|
||||
foo = 1
|
||||
+1
@@ -0,0 +1 @@
|
||||
res = Set("@birds/catalog/Ostrich.pkl", "@birds/catalog/Swallow.pkl")
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
res {
|
||||
foo = 1
|
||||
}
|
||||
Reference in New Issue
Block a user