Replace magic test port 12110 with 0 (#345)

Also introduce constants for some test package SHAs
to make them easier to update.
This commit is contained in:
translatenix
2024-03-20 10:47:28 -07:00
committed by GitHub
parent 2aa60eaf1f
commit dfe85b786e
123 changed files with 469 additions and 469 deletions

View File

@@ -111,8 +111,8 @@ public interface HttpClient extends AutoCloseable {
/**
* Sets a test server's listening port.
*
* <p>If set, requests that specify port 12110 will be modified to use the given port. This is
* an internal test option.
* <p>If set, requests that specify port 0 will be modified to use the given port. This is an
* internal test option.
*/
Builder setTestPort(int port);

View File

@@ -105,9 +105,7 @@ final class RequestRewritingClient implements HttpClient {
}
private URI rewriteUri(URI uri) {
// Would be nice to use port 0 instead of 12110,
// but this is best done in a separate commit.
if (testPort != -1 && uri.getPort() == 12110) {
if (testPort != -1 && uri.getPort() == 0) {
return HttpUtils.setPort(uri, testPort);
}
return uri;

View File

@@ -52,16 +52,16 @@ examples {
}
["package"] {
import*("package://localhost:12110/birds@0.5.0#/catalog/*.pkl")
import*("package://localhost:12110/birds@0.5.0#/**.pkl").keys.toListing()
import*("package://localhost:0/birds@0.5.0#/catalog/*.pkl")
import*("package://localhost:0/birds@0.5.0#/**.pkl").keys.toListing()
}
["globbing with absolute URIs and percent encoding"] {
import*("package://localhost:12110/packageContainingWildcardCharacters@1.0.0#/name%20*")
import*("package://localhost:12110/packageContainingWildcardCharacters@1.0.0#/name%20with%20%5C%5Bwildcard%5D!%20characters~~.pkl")
import*("package://localhost:0/packageContainingWildcardCharacters@1.0.0#/name%20*")
import*("package://localhost:0/packageContainingWildcardCharacters@1.0.0#/name%20with%20%5C%5Bwildcard%5D!%20characters~~.pkl")
}
["package glob and up one level"] {
import*("package://localhost:12110/birds@0.5.0#/catalog/../catalog/*.pkl")
import*("package://localhost:0/birds@0.5.0#/catalog/../catalog/*.pkl")
}
}

View File

@@ -28,6 +28,6 @@ examples {
}
["package:"] {
read*("package://localhost:12110/birds@0.5.0#/**.pkl")
read*("package://localhost:0/birds@0.5.0#/**.pkl")
}
}

View File

@@ -1,2 +1,2 @@
// no semver
res = import("package://localhost:12110/foo#/bar.pkl")
res = import("package://localhost:0/foo#/bar.pkl")

View File

@@ -1 +1 @@
res = import("package://localhost:12110/birds@0.5.0::invalidalgo:abc123#/catalog/Bird.pkl")
res = import("package://localhost:0/birds@0.5.0::invalidalgo:abc123#/catalog/Bird.pkl")

View File

@@ -1 +1 @@
res = import("package://localhost:12110/birds@0.5.0::boguschecksumpart#/catalog/Bird.pkl")
res = import("package://localhost:0/birds@0.5.0::boguschecksumpart#/catalog/Bird.pkl")

View File

@@ -1,2 +1,2 @@
// invalid semver
res = import("package://localhost:12110/foo@notAVersion#/bar.pkl")
res = import("package://localhost:0/foo@notAVersion#/bar.pkl")

View File

@@ -1,2 +1,2 @@
// no fragment
res = import("package://localhost:12110/bar/baz@1.0.0")
res = import("package://localhost:0/bar/baz@1.0.0")

View File

@@ -1,2 +1,2 @@
// fragment path must be absolute
res = import("package://localhost:12110/birds@0.5.0#catalog/Swallow.pkl")
res = import("package://localhost:0/birds@0.5.0#catalog/Swallow.pkl")

View File

@@ -1,3 +1,3 @@
import "package://localhost:12110/badPackageZipUrl@1.0.0#/Bug.pkl"
import "package://localhost:0/badPackageZipUrl@1.0.0#/Bug.pkl"
res: Bug

View File

@@ -1 +1 @@
res = import("package://localhost:12110/badMetadataJson@1.0.0#/Bug.pkl")
res = import("package://localhost:0/badMetadataJson@1.0.0#/Bug.pkl")

View File

@@ -1 +1 @@
res = import("package://localhost:12110/badImportsWithinPackage@1.0.0#/unknownDependency.pkl")
res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/unknownDependency.pkl")

View File

@@ -1 +1 @@
res = import("package://localhost:12110/badImportsWithinPackage@1.0.0#/invalidPath.pkl")
res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/invalidPath.pkl")

View File

@@ -1,2 +1,2 @@
// no semver
res = read("package://localhost:12110/foo#/bar.pkl")
res = read("package://localhost:0/foo#/bar.pkl")

View File

@@ -1,2 +1,2 @@
// invalid semver
res = read("package://localhost:12110/foo@notAVersion#/bar.pkl")
res = read("package://localhost:0/foo@notAVersion#/bar.pkl")

View File

@@ -1,2 +1,2 @@
// no fragment
res = read("package://localhost:12110/bar/baz@1.0.0")
res = read("package://localhost:0/bar/baz@1.0.0")

View File

@@ -1,2 +1,2 @@
// fragment path must be absolute
res = read("package://localhost:12110/birds@0.5.0#catalog/Swallow.pkl")
res = read("package://localhost:0/birds@0.5.0#catalog/Swallow.pkl")

View File

@@ -1 +1 @@
res = import("package://localhost:12110/badImportsWithinPackage@1.0.0#/unknownDependencyReaad.pkl")
res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/unknownDependencyReaad.pkl")

View File

@@ -1 +1 @@
res = import("package://localhost:12110/badImportsWithinPackage@1.0.0#/invalidPathReaad.pkl")
res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/invalidPathReaad.pkl")

View File

@@ -1,7 +1,7 @@
amends ".../snippetTest.pkl"
import "package://localhost:12110/birds@0.5.0#/Bird.pkl"
import "package://localhost:12110/fruit@1.0.5#/Fruit.pkl"
import "package://localhost:0/birds@0.5.0#/Bird.pkl"
import "package://localhost:0/fruit@1.0.5#/Fruit.pkl"
examples {
["basic imports"] {
@@ -12,15 +12,15 @@ examples {
name = "Banana"
}
}
import("package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl")
import("package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl")
import("package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl")
import("package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl")
}
["importing while specifying checksum"] {
import("package://localhost:12110/birds@0.5.0::sha256:3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118#/catalog/Swallow.pkl")
import("package://localhost:0/birds@0.5.0::sha256:3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118#/catalog/Swallow.pkl")
}
["reads"] {
read("package://localhost:12110/birds@0.5.0#/Bird.pkl")
read("package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl")
read("package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl")
read("package://localhost:0/birds@0.5.0#/Bird.pkl")
read("package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl")
read("package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl")
}
}

View File

@@ -2,24 +2,24 @@ amends ".../snippetTest.pkl"
examples {
["glob import"] {
import*("package://localhost:12110/birds@0.5.0#/catalog/*.pkl")
import*("package://localhost:0/birds@0.5.0#/catalog/*.pkl")
}
["glob import within package"] {
import("package://localhost:12110/birds@0.5.0#/catalog.pkl").catalog
import("package://localhost:0/birds@0.5.0#/catalog.pkl").catalog
}
["glob import transitive dep within package"] {
import("package://localhost:12110/birds@0.5.0#/allFruit.pkl").fruit
import("package://localhost:0/birds@0.5.0#/allFruit.pkl").fruit
}
["glob read"] {
read*("package://localhost:12110/birds@0.5.0#/catalog/*.pkl")
read*("package://localhost:0/birds@0.5.0#/catalog/*.pkl")
}
["glob read within package"] {
import("package://localhost:12110/birds@0.5.0#/catalog.pkl").catalogFiles
import("package://localhost:0/birds@0.5.0#/catalog.pkl").catalogFiles
}
["glob read transitive dep within package"] {
import("package://localhost:12110/birds@0.5.0#/allFruit.pkl").fruitFiles
import("package://localhost:0/birds@0.5.0#/allFruit.pkl").fruitFiles
}
["glob import while specifying checksum"] {
import*("package://localhost:12110/birds@0.5.0::sha256:3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118#/catalog/*.pkl")
import*("package://localhost:0/birds@0.5.0::sha256:3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118#/catalog/*.pkl")
}
}

View File

@@ -2,6 +2,6 @@ amends "pkl:Project"
dependencies {
["birds"] {
uri = "package://localhost:12110/birds@0.5.0"
uri = "package://localhost:0/birds@0.5.0"
}
}

View File

@@ -2,6 +2,6 @@ amends "pkl:Project"
dependencies {
["birds"] {
uri = "package://localhost:12110/birds@0.5.0"
uri = "package://localhost:0/birds@0.5.0"
}
}

View File

@@ -2,6 +2,6 @@ amends "pkl:Project"
dependencies {
["birds"] {
uri = "package://localhost:12110/birds@0.5.0"
uri = "package://localhost:0/birds@0.5.0"
}
}

View File

@@ -3,6 +3,6 @@ amends "pkl:Project"
dependencies {
["birds"] {
// Should fail because dependency is out of date (PklProject.deps.json version is older)
uri = "package://localhost:12110/birds@0.5.0"
uri = "package://localhost:0/birds@0.5.0"
}
}

View File

@@ -1,16 +1,16 @@
{
"schemaVersion": 1,
"resolvedDependencies": {
"package://localhost:12110/birds@0": {
"package://localhost:0/birds@0": {
"type": "remote",
"uri": "projectpackage://localhost:12110/birds@0.5.0",
"uri": "projectpackage://localhost:0/birds@0.5.0",
"checksums": {
"sha256": "$skipChecksumVerification"
}
},
"package://localhost:12110/fruit@1": {
"package://localhost:0/fruit@1": {
"type": "remote",
"uri": "projectpackage://localhost:12110/fruit@1.0.0",
"uri": "projectpackage://localhost:0/fruit@1.0.0",
"checksums": {
"sha256": "$skipChecksumVerification"
}

View File

@@ -3,6 +3,6 @@ amends "pkl:Project"
dependencies {
["birds"] {
// out of date because PklProject declares version 0.5.0
uri = "package://localhost:12110/birds@0.8.0"
uri = "package://localhost:0/birds@0.8.0"
}
}

View File

@@ -1,16 +1,16 @@
{
"schemaVersion": 1,
"resolvedDependencies": {
"package://localhost:12110/birds@0": {
"package://localhost:0/birds@0": {
"type": "remote",
"uri": "projectpackage://localhost:12110/birds@0.5.0",
"uri": "projectpackage://localhost:0/birds@0.5.0",
"checksums": {
"sha256": "$skipChecksumVerification"
}
},
"package://localhost:12110/fruit@1": {
"package://localhost:0/fruit@1": {
"type": "remote",
"uri": "projectpackage://localhost:12110/fruit@1.1.0",
"uri": "projectpackage://localhost:0/fruit@1.1.0",
"checksums": {
"sha256": "$skipChecksumVerification"
}

View File

@@ -2,6 +2,6 @@ amends "pkl:Project"
dependencies {
["birds"] {
uri = "package://localhost:12110/birds@0.5.0"
uri = "package://localhost:0/birds@0.5.0"
}
}

View File

@@ -2,13 +2,13 @@ amends "pkl:Project"
dependencies {
["birds"] {
uri = "package://localhost:12110/birds@0.5.0"
uri = "package://localhost:0/birds@0.5.0"
}
["fruits"] {
uri = "package://localhost:12110/fruit@1.1.0"
uri = "package://localhost:0/fruit@1.1.0"
}
["badImportsWithinPackage"] {
uri = "package://localhost:12110/badImportsWithinPackage@1.0.0"
uri = "package://localhost:0/badImportsWithinPackage@1.0.0"
}
["project2"] = import("../project2/PklProject")
}

View File

@@ -1,28 +1,28 @@
{
"schemaVersion": 1,
"resolvedDependencies": {
"package://localhost:12110/birds@0": {
"package://localhost:0/birds@0": {
"type": "remote",
"uri": "projectpackage://localhost:12110/birds@0.5.0",
"uri": "projectpackage://localhost:0/birds@0.5.0",
"checksums": {
"sha256": "$skipChecksumVerification"
}
},
"package://localhost:12110/fruit@1": {
"package://localhost:0/fruit@1": {
"type": "remote",
"uri": "projectpackage://localhost:12110/fruit@1.1.0",
"uri": "projectpackage://localhost:0/fruit@1.1.0",
"checksums": {
"sha256": "$skipChecksumVerification"
}
},
"package://localhost:12110/project2@1": {
"package://localhost:0/project2@1": {
"type": "local",
"uri": "projectpackage://localhost:12110/project2@1.0.0",
"uri": "projectpackage://localhost:0/project2@1.0.0",
"path": "../project2/"
},
"package://localhost:12110/badImportsWithinPackage@1": {
"package://localhost:0/badImportsWithinPackage@1": {
"type": "remote",
"uri": "projectpackage://localhost:12110/badImportsWithinPackage@1.0.0",
"uri": "projectpackage://localhost:0/badImportsWithinPackage@1.0.0",
"checksums": {
"sha256": "$skipChecksumVerification"
}

View File

@@ -22,16 +22,16 @@ examples {
facts {
["package-relative dependency is not same import as absolute URI dependency"] {
import("@birds/Bird.pkl") != import("package://localhost:12110/birds@0.5.0#/Bird.pkl")
import("@birds/Bird.pkl") != import("package://localhost:0/birds@0.5.0#/Bird.pkl")
}
["package-relative dependency has scheme projectpackage"] {
import("@birds/Bird.pkl") == import("projectpackage://localhost:12110/birds@0.5.0#/Bird.pkl")
import("@birds/Bird.pkl") == import("projectpackage://localhost:0/birds@0.5.0#/Bird.pkl")
}
["transitive import resolves to same dependency as direct dependency import"] {
Swallow.favoriteFruit == import("@fruits/catalog/apple.pkl")
}
["transitive import resolves to same dependency as projectpackage import"] {
Swallow.favoriteFruit == import("projectpackage://localhost:12110/fruit@1.1.0#/catalog/apple.pkl")
Swallow.favoriteFruit != import("projectpackage://localhost:12110/fruit@1.0.5#/catalog/apple.pkl")
Swallow.favoriteFruit == import("projectpackage://localhost:0/fruit@1.1.0#/catalog/apple.pkl")
Swallow.favoriteFruit != import("projectpackage://localhost:0/fruit@1.0.5#/catalog/apple.pkl")
}
}

View File

@@ -7,7 +7,7 @@ examples {
}
["glob-import absolute package uri"] {
import*("package://localhost:12110/birds@0.5.0#/catalog/*.pkl")
import*("package://localhost:0/birds@0.5.0#/catalog/*.pkl")
}
["glob-import local project"] {
@@ -32,6 +32,6 @@ examples {
}
["glob-read absolute package uri"] {
read*("package://localhost:12110/birds@0.5.0#/catalog/*.pkl")
read*("package://localhost:0/birds@0.5.0#/catalog/*.pkl")
}
}

View File

@@ -2,13 +2,13 @@ amends "pkl:Project"
package {
name = "project2"
baseUri = "package://localhost:12110/project2"
baseUri = "package://localhost:0/project2"
version = "1.0.0"
packageZipUrl = "https://localhost:12110/project2/project2-\(version).zip"
packageZipUrl = "https://localhost:0/project2/project2-\(version).zip"
}
dependencies {
["burds"] {
uri = "package://localhost:12110/birds@0.5.0"
uri = "package://localhost:0/birds@0.5.0"
}
}

View File

@@ -1,16 +1,16 @@
{
"schemaVersion": 1,
"resolvedDependencies": {
"package://localhost:12110/birds@0": {
"package://localhost:0/birds@0": {
"type": "remote",
"uri": "projectpackage://localhost:12110/birds@0.5.0",
"uri": "projectpackage://localhost:0/birds@0.5.0",
"checksums": {
"sha256": "$skipChecksumVerification"
}
},
"package://localhost:12110/fruit@1": {
"package://localhost:0/fruit@1": {
"type": "remote",
"uri": "projectpackage://localhost:12110/fruit@1.1.0",
"uri": "projectpackage://localhost:0/fruit@1.1.0",
"checksums": {
"sha256": "$skipChecksumVerification"
}

View File

@@ -1,28 +1,28 @@
{
"schemaVersion": 1,
"resolvedDependencies": {
"package://localhost:12110/birds@0": {
"package://localhost:0/birds@0": {
"type": "remote",
"uri": "projectpackage://localhost:12110/birds@0.5.0",
"uri": "projectpackage://localhost:0/birds@0.5.0",
"checksums": {
"sha256": "$skipChecksumVerification"
}
},
"package://localhost:12110/fruit@1": {
"package://localhost:0/fruit@1": {
"type": "remote",
"uri": "projectpackage://localhost:12110/fruit@1.1.0",
"uri": "projectpackage://localhost:0/fruit@1.1.0",
"checksums": {
"sha256": "$skipChecksumVerification"
}
},
"package://localhost:12110/project2@1": {
"package://localhost:0/project2@1": {
"type": "local",
"uri": "projectpackage://localhost:12110/project2@1.0.0",
"uri": "projectpackage://localhost:0/project2@1.0.0",
"path": "../project2/"
},
"package://localhost:12110/badImportsWithinPackage@1": {
"package://localhost:0/badImportsWithinPackage@1": {
"type": "remote",
"uri": "projectpackage://localhost:12110/badImportsWithinPackage@1.0.0",
"uri": "projectpackage://localhost:0/badImportsWithinPackage@1.0.0",
"checksums": {
"sha256": "$skipChecksumVerification"
}

View File

@@ -3,6 +3,6 @@ amends "pkl:Project"
dependencies {
["fruit"] {
// need to manually keep the checksum in `PklProject.deps.json` in sync
uri = "package://localhost:12110/fruit@1.0.5"
uri = "package://localhost:0/fruit@1.0.5"
}
}

View File

@@ -1,11 +1,11 @@
{
"schemaVersion": 1,
"resolvedDependencies": {
"package://localhost:12110/fruit@1": {
"package://localhost:0/fruit@1": {
"type": "remote",
"uri": "projectpackage://localhost:12110/fruit@1.0.5",
"uri": "projectpackage://localhost:0/fruit@1.0.5",
"checksums": {
"sha256": "abd173e8a25f5b930b0e34269a441e32c9d95e0b0a715bc6eff918f0afd0688e"
"sha256": "34a15b02346e6acb85da5bd71d8b0738a79008b38a7fc805e5869d9129ad27d2"
}
}
}

View File

@@ -5,7 +5,7 @@ import "pkl:reflect"
myProject: Project = (Project.newInstance(module)) {
dependencies {
["birds"] {
uri = "package://localhost:12110/birds@0.5.0"
uri = "package://localhost:0/birds@0.5.0"
}
}
}

View File

@@ -1,16 +1,16 @@
{
"schemaVersion": 1,
"resolvedDependencies": {
"package://localhost:12110/birds@0": {
"package://localhost:0/birds@0": {
"type": "remote",
"uri": "projectpackage://localhost:12110/birds@0.5.0",
"uri": "projectpackage://localhost:0/birds@0.5.0",
"checksums": {
"sha256": "$skipChecksumVerification"
}
},
"package://localhost:12110/fruit@1": {
"package://localhost:0/fruit@1": {
"type": "remote",
"uri": "projectpackage://localhost:12110/fruit@1.1.0",
"uri": "projectpackage://localhost:0/fruit@1.1.0",
"checksums": {
"sha256": "$skipChecksumVerification"
}

View File

@@ -69,13 +69,13 @@ examples {
}
["package"] {
new {
["package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"] {
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] {
name = "Ostritch"
favoriteFruit {
name = "Orange"
}
}
["package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"] {
["package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"] {
name = "Swallow"
favoriteFruit {
name = "Apple"
@@ -83,31 +83,31 @@ examples {
}
}
new {
"package://localhost:12110/birds@0.5.0#/Bird.pkl"
"package://localhost:12110/birds@0.5.0#/allFruit.pkl"
"package://localhost:12110/birds@0.5.0#/catalog.pkl"
"package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"
"package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"
"package://localhost:12110/birds@0.5.0#/some/dir/Bird.pkl"
"package://localhost:0/birds@0.5.0#/Bird.pkl"
"package://localhost:0/birds@0.5.0#/allFruit.pkl"
"package://localhost:0/birds@0.5.0#/catalog.pkl"
"package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
"package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
"package://localhost:0/birds@0.5.0#/some/dir/Bird.pkl"
}
}
["globbing with absolute URIs and percent encoding"] {
new {
["package://localhost:12110/packageContainingWildcardCharacters@1.0.0#/name%20with%20%5Bwildcard%5D!%20characters~~.pkl"] {}
["package://localhost:0/packageContainingWildcardCharacters@1.0.0#/name%20with%20%5Bwildcard%5D!%20characters~~.pkl"] {}
}
new {
["package://localhost:12110/packageContainingWildcardCharacters@1.0.0#/name%20with%20%5Bwildcard%5D!%20characters~~.pkl"] {}
["package://localhost:0/packageContainingWildcardCharacters@1.0.0#/name%20with%20%5Bwildcard%5D!%20characters~~.pkl"] {}
}
}
["package glob and up one level"] {
new {
["package://localhost:12110/birds@0.5.0#/catalog/../catalog/Ostritch.pkl"] {
["package://localhost:0/birds@0.5.0#/catalog/../catalog/Ostritch.pkl"] {
name = "Ostritch"
favoriteFruit {
name = "Orange"
}
}
["package://localhost:12110/birds@0.5.0#/catalog/../catalog/Swallow.pkl"] {
["package://localhost:0/birds@0.5.0#/catalog/../catalog/Swallow.pkl"] {
name = "Swallow"
favoriteFruit {
name = "Apple"

View File

@@ -96,8 +96,8 @@ examples {
}
["package:"] {
new {
["package://localhost:12110/birds@0.5.0#/Bird.pkl"] {
uri = "package://localhost:12110/birds@0.5.0#/Bird.pkl"
["package://localhost:0/birds@0.5.0#/Bird.pkl"] {
uri = "package://localhost:0/birds@0.5.0#/Bird.pkl"
text = """
open module birds.Bird
@@ -110,8 +110,8 @@ examples {
"""
base64 = "b3BlbiBtb2R1bGUgYmlyZHMuQmlyZAoKaW1wb3J0ICJAZnJ1aXRpZXMvRnJ1aXQucGtsIgoKbmFtZTogU3RyaW5nCgpmYXZvcml0ZUZydWl0OiBGcnVpdAo="
}
["package://localhost:12110/birds@0.5.0#/allFruit.pkl"] {
uri = "package://localhost:12110/birds@0.5.0#/allFruit.pkl"
["package://localhost:0/birds@0.5.0#/allFruit.pkl"] {
uri = "package://localhost:0/birds@0.5.0#/allFruit.pkl"
text = """
module birds.allFruit
@@ -121,8 +121,8 @@ examples {
"""
base64 = "bW9kdWxlIGJpcmRzLmFsbEZydWl0CgpmcnVpdCA9IGltcG9ydCooIkBmcnVpdGllcy9jYXRhbG9nLyoucGtsIikKZnJ1aXRGaWxlcyA9IHJlYWQqKCJAZnJ1aXRpZXMvY2F0YWxvZy8qLnBrbCIpCg=="
}
["package://localhost:12110/birds@0.5.0#/catalog.pkl"] {
uri = "package://localhost:12110/birds@0.5.0#/catalog.pkl"
["package://localhost:0/birds@0.5.0#/catalog.pkl"] {
uri = "package://localhost:0/birds@0.5.0#/catalog.pkl"
text = """
module birds.catalog
@@ -132,8 +132,8 @@ examples {
"""
base64 = "bW9kdWxlIGJpcmRzLmNhdGFsb2cKCmNhdGFsb2cgPSBpbXBvcnQqKCJjYXRhbG9nLyoucGtsIikKY2F0YWxvZ0ZpbGVzID0gcmVhZCooImNhdGFsb2cvKi5wa2wiKQo="
}
["package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"] {
uri = "package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] {
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
text = """
amends "../Bird.pkl"
@@ -146,8 +146,8 @@ examples {
"""
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo="
}
["package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"] {
uri = "package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"
["package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"] {
uri = "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
text = """
amends "../Bird.pkl"
@@ -160,8 +160,8 @@ examples {
"""
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCmltcG9ydCAiQGZydWl0aWVzL2NhdGFsb2cvYXBwbGUucGtsIgoKbmFtZSA9ICJTd2FsbG93IgoKZmF2b3JpdGVGcnVpdCA9IGFwcGxlCg=="
}
["package://localhost:12110/birds@0.5.0#/some/dir/Bird.pkl"] {
uri = "package://localhost:12110/birds@0.5.0#/some/dir/Bird.pkl"
["package://localhost:0/birds@0.5.0#/some/dir/Bird.pkl"] {
uri = "package://localhost:0/birds@0.5.0#/some/dir/Bird.pkl"
text = """
amends "..."

View File

@@ -1,8 +1,8 @@
Pkl Error
Module URI `package://localhost:12110/foo#/bar.pkl` has invalid syntax.
Module URI `package://localhost:0/foo#/bar.pkl` has invalid syntax.
x | res = import("package://localhost:12110/foo#/bar.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
x | res = import("package://localhost:0/foo#/bar.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
at badImport1.error#res (file:///$snippetsDir/input/packages/badImport1.error.pkl)
Invalid path `/foo`.

View File

@@ -1,8 +1,8 @@
Pkl Error
Module URI `package://localhost:12110/birds@0.5.0::invalidalgo:abc123#/catalog/Bird.pkl` has invalid syntax.
Module URI `package://localhost:0/birds@0.5.0::invalidalgo:abc123#/catalog/Bird.pkl` has invalid syntax.
x | res = import("package://localhost:12110/birds@0.5.0::invalidalgo:abc123#/catalog/Bird.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
x | res = import("package://localhost:0/birds@0.5.0::invalidalgo:abc123#/catalog/Bird.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
at badImport10.error#res (file:///$snippetsDir/input/packages/badImport10.error.pkl)
Unrecognized checksum algorithm: `invalidalgo`.

View File

@@ -1,8 +1,8 @@
Pkl Error
Module URI `package://localhost:12110/birds@0.5.0::boguschecksumpart#/catalog/Bird.pkl` has invalid syntax.
Module URI `package://localhost:0/birds@0.5.0::boguschecksumpart#/catalog/Bird.pkl` has invalid syntax.
x | res = import("package://localhost:12110/birds@0.5.0::boguschecksumpart#/catalog/Bird.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
x | res = import("package://localhost:0/birds@0.5.0::boguschecksumpart#/catalog/Bird.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
at badImport11.error#res (file:///$snippetsDir/input/packages/badImport11.error.pkl)
Invalid checksum specification: `boguschecksumpart`.

View File

@@ -1,8 +1,8 @@
Pkl Error
Module URI `package://localhost:12110/foo@notAVersion#/bar.pkl` has invalid syntax.
Module URI `package://localhost:0/foo@notAVersion#/bar.pkl` has invalid syntax.
x | res = import("package://localhost:12110/foo@notAVersion#/bar.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
x | res = import("package://localhost:0/foo@notAVersion#/bar.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
at badImport2.error#res (file:///$snippetsDir/input/packages/badImport2.error.pkl)
`notAVersion` could not be parsed as a semantic version number.

View File

@@ -1,8 +1,8 @@
Pkl Error
Module URI `package://localhost:12110/bar/baz@1.0.0` has invalid syntax.
Module URI `package://localhost:0/bar/baz@1.0.0` has invalid syntax.
x | res = import("package://localhost:12110/bar/baz@1.0.0")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
x | res = import("package://localhost:0/bar/baz@1.0.0")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
at badImport3.error#res (file:///$snippetsDir/input/packages/badImport3.error.pkl)
Expected URI to contain a fragment.

View File

@@ -1,8 +1,8 @@
Pkl Error
Module URI `package://localhost:12110/birds@0.5.0#catalog/Swallow.pkl` has invalid syntax.
Module URI `package://localhost:0/birds@0.5.0#catalog/Swallow.pkl` has invalid syntax.
x | res = import("package://localhost:12110/birds@0.5.0#catalog/Swallow.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
x | res = import("package://localhost:0/birds@0.5.0#catalog/Swallow.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
at badImport4.error#res (file:///$snippetsDir/input/packages/badImport4.error.pkl)
Cannot have a relative fragment path `catalog/Swallow.pkl`.

View File

@@ -1,8 +1,8 @@
Pkl Error
Expected the zip asset for package `package://localhost:12110/badPackageZipUrl@1.0.0` to be an HTTPS URI, but got `ftp://wait/a/minute`.
Expected the zip asset for package `package://localhost:0/badPackageZipUrl@1.0.0` to be an HTTPS URI, but got `ftp://wait/a/minute`.
x | import "package://localhost:12110/badPackageZipUrl@1.0.0#/Bug.pkl"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
x | import "package://localhost:0/badPackageZipUrl@1.0.0#/Bug.pkl"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
at badImport6.error#Bug (file:///$snippetsDir/input/packages/badImport6.error.pkl)
x | res: Bug

View File

@@ -1,13 +1,13 @@
Pkl Error
Received invalid dependency metadata for package `package://localhost:12110/badMetadataJson@1.0.0` when making request `GET https://localhost:12110/badMetadataJson@1.0.0`:
Received invalid dependency metadata for package `package://localhost:0/badMetadataJson@1.0.0` when making request `GET https://localhost:0/badMetadataJson@1.0.0`:
Malformed JSON: Expected 'r' at 1:2.
Original input:
`this is not json
`
x | res = import("package://localhost:12110/badMetadataJson@1.0.0#/Bug.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
x | res = import("package://localhost:0/badMetadataJson@1.0.0#/Bug.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
at badImport7.error#res (file:///$snippetsDir/input/packages/badImport7.error.pkl)
xxx | text = renderer.renderDocument(value)

View File

@@ -1,9 +1,9 @@
Pkl Error
Cannot find dependency named `fruits`, because it was not declared in package `package://localhost:12110/badImportsWithinPackage@1.0.0`.
Cannot find dependency named `fruits`, because it was not declared in package `package://localhost:0/badImportsWithinPackage@1.0.0`.
x | res = import("@fruits/Foo.pkl")
^^^^^^^^^^^^^^^^^
at badImport8.error#res (package://localhost:12110/badImportsWithinPackage@1.0.0#/unknownDependency.pkl)
at badImport8.error#res (package://localhost:0/badImportsWithinPackage@1.0.0#/unknownDependency.pkl)
xxx | text = renderer.renderDocument(value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@@ -1,9 +1,9 @@
Pkl Error
Cannot find module `package://localhost:12110/badImportsWithinPackage@1.0.0#/not/a/valid/path.pkl`.
Cannot find module `package://localhost:0/badImportsWithinPackage@1.0.0#/not/a/valid/path.pkl`.
x | res = import("not/a/valid/path.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
at invalidPath#res (package://localhost:12110/badImportsWithinPackage@1.0.0#/invalidPath.pkl)
at invalidPath#res (package://localhost:0/badImportsWithinPackage@1.0.0#/invalidPath.pkl)
xxx | text = renderer.renderDocument(value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@@ -1,8 +1,8 @@
Pkl Error
Resource URI `package://localhost:12110/foo#/bar.pkl` has invalid syntax.
Resource URI `package://localhost:0/foo#/bar.pkl` has invalid syntax.
x | res = read("package://localhost:12110/foo#/bar.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
x | res = read("package://localhost:0/foo#/bar.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
at badRead1.error#res (file:///$snippetsDir/input/packages/badRead1.error.pkl)
Invalid path `/foo`.

View File

@@ -1,8 +1,8 @@
Pkl Error
Resource URI `package://localhost:12110/foo@notAVersion#/bar.pkl` has invalid syntax.
Resource URI `package://localhost:0/foo@notAVersion#/bar.pkl` has invalid syntax.
x | res = read("package://localhost:12110/foo@notAVersion#/bar.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
x | res = read("package://localhost:0/foo@notAVersion#/bar.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
at badRead2.error#res (file:///$snippetsDir/input/packages/badRead2.error.pkl)
`notAVersion` could not be parsed as a semantic version number.

View File

@@ -1,8 +1,8 @@
Pkl Error
Resource URI `package://localhost:12110/bar/baz@1.0.0` has invalid syntax.
Resource URI `package://localhost:0/bar/baz@1.0.0` has invalid syntax.
x | res = read("package://localhost:12110/bar/baz@1.0.0")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
x | res = read("package://localhost:0/bar/baz@1.0.0")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
at badRead3.error#res (file:///$snippetsDir/input/packages/badRead3.error.pkl)
Expected URI to contain a fragment.

View File

@@ -1,8 +1,8 @@
Pkl Error
Resource URI `package://localhost:12110/birds@0.5.0#catalog/Swallow.pkl` has invalid syntax.
Resource URI `package://localhost:0/birds@0.5.0#catalog/Swallow.pkl` has invalid syntax.
x | res = read("package://localhost:12110/birds@0.5.0#catalog/Swallow.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
x | res = read("package://localhost:0/birds@0.5.0#catalog/Swallow.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
at badRead4.error#res (file:///$snippetsDir/input/packages/badRead4.error.pkl)
Cannot have a relative fragment path `catalog/Swallow.pkl`.

View File

@@ -1,8 +1,8 @@
Pkl Error
Cannot find module `package://localhost:12110/badImportsWithinPackage@1.0.0#/unknownDependencyReaad.pkl`.
Cannot find module `package://localhost:0/badImportsWithinPackage@1.0.0#/unknownDependencyReaad.pkl`.
x | res = import("package://localhost:12110/badImportsWithinPackage@1.0.0#/unknownDependencyReaad.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
x | res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/unknownDependencyReaad.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
at badRead8.error#res (file:///$snippetsDir/input/packages/badRead8.error.pkl)
xxx | text = renderer.renderDocument(value)

View File

@@ -1,8 +1,8 @@
Pkl Error
Cannot find module `package://localhost:12110/badImportsWithinPackage@1.0.0#/invalidPathReaad.pkl`.
Cannot find module `package://localhost:0/badImportsWithinPackage@1.0.0#/invalidPathReaad.pkl`.
x | res = import("package://localhost:12110/badImportsWithinPackage@1.0.0#/invalidPathReaad.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
x | res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/invalidPathReaad.pkl")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
at badRead9.error#res (file:///$snippetsDir/input/packages/badRead9.error.pkl)
xxx | text = renderer.renderDocument(value)

View File

@@ -29,7 +29,7 @@ examples {
}
["reads"] {
new {
uri = "package://localhost:12110/birds@0.5.0#/Bird.pkl"
uri = "package://localhost:0/birds@0.5.0#/Bird.pkl"
text = """
open module birds.Bird
@@ -43,7 +43,7 @@ examples {
base64 = "b3BlbiBtb2R1bGUgYmlyZHMuQmlyZAoKaW1wb3J0ICJAZnJ1aXRpZXMvRnJ1aXQucGtsIgoKbmFtZTogU3RyaW5nCgpmYXZvcml0ZUZydWl0OiBGcnVpdAo="
}
new {
uri = "package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"
uri = "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
text = """
amends "../Bird.pkl"
@@ -57,7 +57,7 @@ examples {
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCmltcG9ydCAiQGZydWl0aWVzL2NhdGFsb2cvYXBwbGUucGtsIgoKbmFtZSA9ICJTd2FsbG93IgoKZmF2b3JpdGVGcnVpdCA9IGFwcGxlCg=="
}
new {
uri = "package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
text = """
amends "../Bird.pkl"

View File

@@ -1,13 +1,13 @@
examples {
["glob import"] {
new {
["package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"] {
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] {
name = "Ostritch"
favoriteFruit {
name = "Orange"
}
}
["package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"] {
["package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"] {
name = "Swallow"
favoriteFruit {
name = "Apple"
@@ -40,8 +40,8 @@ examples {
}
["glob read"] {
new {
["package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"] {
uri = "package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] {
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
text = """
amends "../Bird.pkl"
@@ -54,8 +54,8 @@ examples {
"""
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo="
}
["package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"] {
uri = "package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"
["package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"] {
uri = "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
text = """
amends "../Bird.pkl"
@@ -73,7 +73,7 @@ examples {
["glob read within package"] {
new {
["catalog/Ostritch.pkl"] {
uri = "package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
text = """
amends "../Bird.pkl"
@@ -87,7 +87,7 @@ examples {
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo="
}
["catalog/Swallow.pkl"] {
uri = "package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"
uri = "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
text = """
amends "../Bird.pkl"
@@ -105,7 +105,7 @@ examples {
["glob read transitive dep within package"] {
new {
["@fruities/catalog/apple.pkl"] {
uri = "package://localhost:12110/fruit@1.0.5#/catalog/apple.pkl"
uri = "package://localhost:0/fruit@1.0.5#/catalog/apple.pkl"
text = """
amends "../Fruit.pkl"
@@ -118,13 +118,13 @@ examples {
}
["glob import while specifying checksum"] {
new {
["package://localhost:12110/birds@0.5.0::sha256:3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118#/catalog/Ostritch.pkl"] {
["package://localhost:0/birds@0.5.0::sha256:3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118#/catalog/Ostritch.pkl"] {
name = "Ostritch"
favoriteFruit {
name = "Orange"
}
}
["package://localhost:12110/birds@0.5.0::sha256:3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118#/catalog/Swallow.pkl"] {
["package://localhost:0/birds@0.5.0::sha256:3f19ab9fcee2f44f93a75a09e531db278c6d2cd25206836c8c2c4071cd7d3118#/catalog/Swallow.pkl"] {
name = "Swallow"
favoriteFruit {
name = "Apple"

View File

@@ -1,5 +1,5 @@
Pkl Error
Did not find a resolved dependency for package `package://localhost:12110/birds@0.5.0`.
Did not find a resolved dependency for package `package://localhost:0/birds@0.5.0`.
Run `pkl project resolve` to update resolved dependencies.

View File

@@ -1,14 +1,14 @@
Pkl Error
Transitive dependency declared by package `package://localhost:12110/birds@0.5.0` is newer than what is declared in `PklProject.deps.json`.
Transitive dependency declared by package `package://localhost:0/birds@0.5.0` is newer than what is declared in `PklProject.deps.json`.
Declared: `package://localhost:12110/fruit@1.0.5`
Resolved: `package://localhost:12110/fruit@1.0.0`
Declared: `package://localhost:0/fruit@1.0.5`
Resolved: `package://localhost:0/fruit@1.0.0`
Run `pkl project resolve` to update resolved dependencies.
x | import "@fruities/Fruit.pkl"
^^^^^^^^^^^^^^^^^^^^^
at bug#Bird (projectpackage://localhost:12110/birds@0.5.0#/Bird.pkl)
at bug#Bird (projectpackage://localhost:0/birds@0.5.0#/Bird.pkl)
x | bird: Bird
^^^^

View File

@@ -1,8 +1,8 @@
Pkl Error
Project `file:///$snippetsDir/input/projects/badProjectDeps6/PklProject` declares a dependency on a package that is newer than what is declared in `PklProject.deps.json`.
Declared: `package://localhost:12110/birds@0.8.0`
Resolved: `package://localhost:12110/birds@0.5.0`
Declared: `package://localhost:0/birds@0.8.0`
Resolved: `package://localhost:0/birds@0.5.0`
Run `pkl project resolve` to update resolved dependencies.

View File

@@ -1,9 +1,9 @@
Pkl Error
Cannot find dependency named `fruits`, because it was not declared in package `package://localhost:12110/badImportsWithinPackage@1.0.0`.
Cannot find dependency named `fruits`, because it was not declared in package `package://localhost:0/badImportsWithinPackage@1.0.0`.
x | res = import("@fruits/Foo.pkl")
^^^^^^^^^^^^^^^^^
at badImport3.error#res (projectpackage://localhost:12110/badImportsWithinPackage@1.0.0#/unknownDependency.pkl)
at badImport3.error#res (projectpackage://localhost:0/badImportsWithinPackage@1.0.0#/unknownDependency.pkl)
xxx | text = renderer.renderDocument(value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@@ -38,7 +38,7 @@ examples {
}
["reading directories"] {
new {
uri = "projectpackage://localhost:12110/birds@0.5.0#/catalog"
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog"
text = """
Ostritch.pkl
Swallow.pkl
@@ -47,7 +47,7 @@ examples {
base64 = "T3N0cml0Y2gucGtsClN3YWxsb3cucGtsCg=="
}
new {
uri = "projectpackage://localhost:12110/birds@0.5.0#/"
uri = "projectpackage://localhost:0/birds@0.5.0#/"
text = """
Bird.pkl
allFruit.pkl

View File

@@ -1,5 +1,5 @@
Pkl Error
I/O error loading module `projectpackage://localhost:12110/birds@0.5.0#/`.
I/O error loading module `projectpackage://localhost:0/birds@0.5.0#/`.
IOException: Is a directory
x | res = import("@birds")

View File

@@ -17,13 +17,13 @@ examples {
}
["glob-import absolute package uri"] {
new {
["package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"] {
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] {
name = "Ostritch"
favoriteFruit {
name = "Orange"
}
}
["package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"] {
["package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"] {
name = "Swallow"
favoriteFruit {
name = "Apple"
@@ -42,7 +42,7 @@ examples {
["glob-read using dependency notation"] {
new {
["@birds/catalog/Ostritch.pkl"] {
uri = "projectpackage://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
text = """
amends "../Bird.pkl"
@@ -56,7 +56,7 @@ examples {
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo="
}
["@birds/catalog/Swallow.pkl"] {
uri = "projectpackage://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
text = """
amends "../Bird.pkl"
@@ -72,7 +72,7 @@ examples {
}
new {
["@birds/Bird.pkl"] {
uri = "projectpackage://localhost:12110/birds@0.5.0#/Bird.pkl"
uri = "projectpackage://localhost:0/birds@0.5.0#/Bird.pkl"
text = """
open module birds.Bird
@@ -86,7 +86,7 @@ examples {
base64 = "b3BlbiBtb2R1bGUgYmlyZHMuQmlyZAoKaW1wb3J0ICJAZnJ1aXRpZXMvRnJ1aXQucGtsIgoKbmFtZTogU3RyaW5nCgpmYXZvcml0ZUZydWl0OiBGcnVpdAo="
}
["@birds/allFruit.pkl"] {
uri = "projectpackage://localhost:12110/birds@0.5.0#/allFruit.pkl"
uri = "projectpackage://localhost:0/birds@0.5.0#/allFruit.pkl"
text = """
module birds.allFruit
@@ -97,7 +97,7 @@ examples {
base64 = "bW9kdWxlIGJpcmRzLmFsbEZydWl0CgpmcnVpdCA9IGltcG9ydCooIkBmcnVpdGllcy9jYXRhbG9nLyoucGtsIikKZnJ1aXRGaWxlcyA9IHJlYWQqKCJAZnJ1aXRpZXMvY2F0YWxvZy8qLnBrbCIpCg=="
}
["@birds/catalog.pkl"] {
uri = "projectpackage://localhost:12110/birds@0.5.0#/catalog.pkl"
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog.pkl"
text = """
module birds.catalog
@@ -110,7 +110,7 @@ examples {
}
new {
["@birds/Bird.pkl"] {
uri = "projectpackage://localhost:12110/birds@0.5.0#/Bird.pkl"
uri = "projectpackage://localhost:0/birds@0.5.0#/Bird.pkl"
text = """
open module birds.Bird
@@ -124,7 +124,7 @@ examples {
base64 = "b3BlbiBtb2R1bGUgYmlyZHMuQmlyZAoKaW1wb3J0ICJAZnJ1aXRpZXMvRnJ1aXQucGtsIgoKbmFtZTogU3RyaW5nCgpmYXZvcml0ZUZydWl0OiBGcnVpdAo="
}
["@birds/allFruit.pkl"] {
uri = "projectpackage://localhost:12110/birds@0.5.0#/allFruit.pkl"
uri = "projectpackage://localhost:0/birds@0.5.0#/allFruit.pkl"
text = """
module birds.allFruit
@@ -135,7 +135,7 @@ examples {
base64 = "bW9kdWxlIGJpcmRzLmFsbEZydWl0CgpmcnVpdCA9IGltcG9ydCooIkBmcnVpdGllcy9jYXRhbG9nLyoucGtsIikKZnJ1aXRGaWxlcyA9IHJlYWQqKCJAZnJ1aXRpZXMvY2F0YWxvZy8qLnBrbCIpCg=="
}
["@birds/catalog.pkl"] {
uri = "projectpackage://localhost:12110/birds@0.5.0#/catalog.pkl"
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog.pkl"
text = """
module birds.catalog
@@ -146,7 +146,7 @@ examples {
base64 = "bW9kdWxlIGJpcmRzLmNhdGFsb2cKCmNhdGFsb2cgPSBpbXBvcnQqKCJjYXRhbG9nLyoucGtsIikKY2F0YWxvZ0ZpbGVzID0gcmVhZCooImNhdGFsb2cvKi5wa2wiKQo="
}
["@birds/catalog/Ostritch.pkl"] {
uri = "projectpackage://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
text = """
amends "../Bird.pkl"
@@ -160,7 +160,7 @@ examples {
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo="
}
["@birds/catalog/Swallow.pkl"] {
uri = "projectpackage://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
text = """
amends "../Bird.pkl"
@@ -174,7 +174,7 @@ examples {
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCmltcG9ydCAiQGZydWl0aWVzL2NhdGFsb2cvYXBwbGUucGtsIgoKbmFtZSA9ICJTd2FsbG93IgoKZmF2b3JpdGVGcnVpdCA9IGFwcGxlCg=="
}
["@birds/some/dir/Bird.pkl"] {
uri = "projectpackage://localhost:12110/birds@0.5.0#/some/dir/Bird.pkl"
uri = "projectpackage://localhost:0/birds@0.5.0#/some/dir/Bird.pkl"
text = """
amends "..."
@@ -192,7 +192,7 @@ examples {
["glob-read within package"] {
new {
["catalog/Ostritch.pkl"] {
uri = "projectpackage://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
text = """
amends "../Bird.pkl"
@@ -206,7 +206,7 @@ examples {
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo="
}
["catalog/Swallow.pkl"] {
uri = "projectpackage://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
text = """
amends "../Bird.pkl"
@@ -223,8 +223,8 @@ examples {
}
["glob-read absolute package uri"] {
new {
["package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"] {
uri = "package://localhost:12110/birds@0.5.0#/catalog/Ostritch.pkl"
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] {
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
text = """
amends "../Bird.pkl"
@@ -237,8 +237,8 @@ examples {
"""
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo="
}
["package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"] {
uri = "package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"
["package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"] {
uri = "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
text = """
amends "../Bird.pkl"

View File

@@ -17,7 +17,7 @@ class StackFrameTransformersTest {
.setHttpClient(httpClient)
.build().use {
val frame = StackFrame(
"package://localhost:12110/birds@0.5.0#/Bird.pkl",
"package://localhost:0/birds@0.5.0#/Bird.pkl",
null,
listOf(),
1,

View File

@@ -104,10 +104,10 @@ class RequestRewritingClientTest {
}
@Test
fun `rewrites port 12110 if test port is set`() {
fun `rewrites port 0 if test port is set`() {
val captured = RequestCapturingClient()
val client = RequestRewritingClient("Pkl", Duration.ofSeconds(42), 5000, captured)
val request = HttpRequest.newBuilder(URI("https://example.com:12110")).build()
val request = HttpRequest.newBuilder(URI("https://example.com:0")).build()
client.send(request, BodyHandlers.discarding())
@@ -115,12 +115,12 @@ class RequestRewritingClientTest {
}
@Test
fun `leaves port 12110 intact if no test port is set`() {
val request = HttpRequest.newBuilder(URI("https://example.com:12110")).build()
fun `leaves port 0 intact if no test port is set`() {
val request = HttpRequest.newBuilder(URI("https://example.com:0")).build()
client.send(request, BodyHandlers.discarding())
assertThat(captured.request.uri().port).isEqualTo(12110)
assertThat(captured.request.uri().port).isEqualTo(0)
}
}

View File

@@ -160,7 +160,7 @@ class ModuleKeysTest {
@Test
fun `package - no version`() {
val e = assertThrows<URISyntaxException> {
ModuleKeys.pkg(URI("package://localhost:12110/birds#/Bird.pkl"))
ModuleKeys.pkg(URI("package://localhost:0/birds#/Bird.pkl"))
}
assertThat(e).hasMessageContaining("A package URI must have its path suffixed by its version")
}
@@ -168,7 +168,7 @@ class ModuleKeysTest {
@Test
fun `package - invalid semver`() {
val e = assertThrows<URISyntaxException> {
ModuleKeys.pkg(URI("package://localhost:12110/birds@notAVersion#/Bird.pkl"))
ModuleKeys.pkg(URI("package://localhost:0/birds@notAVersion#/Bird.pkl"))
}
assertThat(e).hasMessageContaining("`notAVersion` could not be parsed")
}

View File

@@ -47,7 +47,7 @@ class PackageResolversTest {
@Test
fun `get module bytes`() {
val expectedBirdModule = packageRoot.resolve("birds@0.5.0/package/Bird.pkl").readString(StandardCharsets.UTF_8)
val assetUri = PackageAssetUri("package://localhost:12110/birds@0.5.0#/Bird.pkl")
val assetUri = PackageAssetUri("package://localhost:0/birds@0.5.0#/Bird.pkl")
val birdModule = resolver
.getBytes(assetUri, false, null)
.toString(StandardCharsets.UTF_8)
@@ -56,7 +56,7 @@ class PackageResolversTest {
@Test
fun `get directory`() {
val assetUri = PackageAssetUri("package://localhost:12110/birds@0.5.0#/")
val assetUri = PackageAssetUri("package://localhost:0/birds@0.5.0#/")
val err = assertThrows<IOException> {
resolver
.getBytes(assetUri, false, null)
@@ -67,7 +67,7 @@ class PackageResolversTest {
@Test
fun `get directory, allowing directory reads`() {
val assetUri = PackageAssetUri("package://localhost:12110/birds@0.5.0#/")
val assetUri = PackageAssetUri("package://localhost:0/birds@0.5.0#/")
val bytes = resolver
.getBytes(assetUri, true, null)
.toString(StandardCharsets.UTF_8)
@@ -84,7 +84,7 @@ class PackageResolversTest {
@Test
fun `get module bytes resolving path`() {
val expectedBirdModule = packageRoot.resolve("birds@0.5.0/package/Bird.pkl").readString(StandardCharsets.UTF_8)
val assetUri = PackageAssetUri("package://localhost:12110/birds@0.5.0#/foo/../Bird.pkl")
val assetUri = PackageAssetUri("package://localhost:0/birds@0.5.0#/foo/../Bird.pkl")
val birdModule = resolver
.getBytes(assetUri, false, null)
.toString(StandardCharsets.UTF_8)
@@ -95,7 +95,7 @@ class PackageResolversTest {
fun `list path elements at root`() {
// cast to set to avoid sort issues
val elements = resolver
.listElements(PackageAssetUri("package://localhost:12110/birds@0.5.0#/"), null)
.listElements(PackageAssetUri("package://localhost:0/birds@0.5.0#/"), null)
.toSet()
assertThat(elements).isEqualTo(
setOf(
@@ -111,12 +111,12 @@ class PackageResolversTest {
@Test
fun `get multiple assets`() {
val bird = resolver.getBytes(
PackageAssetUri("package://localhost:12110/birds@0.5.0#/Bird.pkl"),
PackageAssetUri("package://localhost:0/birds@0.5.0#/Bird.pkl"),
false,
null
)
val swallow = resolver.getBytes(
PackageAssetUri("package://localhost:12110/birds@0.5.0#/catalog/Swallow.pkl"),
PackageAssetUri("package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"),
false,
null
)
@@ -127,7 +127,7 @@ class PackageResolversTest {
@Test
fun `list path elements in nested directory`() {
// cast to set to avoid sort issues
val elements = resolver.listElements(PackageAssetUri("package://localhost:12110/birds@0.5.0#/catalog/"), null).toSet()
val elements = resolver.listElements(PackageAssetUri("package://localhost:0/birds@0.5.0#/catalog/"), null).toSet()
assertThat(elements).isEqualTo(
setOf(
PathElement("Ostritch.pkl", false),
@@ -141,7 +141,7 @@ class PackageResolversTest {
assertThrows<FileNotFoundException> {
resolver
.getBytes(
PackageAssetUri("package://localhost:12110/birds@0.5.0#/Horse.pkl"),
PackageAssetUri("package://localhost:0/birds@0.5.0#/Horse.pkl"),
false,
null
)
@@ -154,7 +154,7 @@ class PackageResolversTest {
assertThrows<PackageLoadError> {
resolver
.getBytes(
PackageAssetUri("package://localhost:12110/not-a-package@0.5.0#/Horse.pkl"),
PackageAssetUri("package://localhost:0/not-a-package@0.5.0#/Horse.pkl"),
false,
null)
.toString(StandardCharsets.UTF_8)
@@ -165,18 +165,18 @@ class PackageResolversTest {
fun `requires package zip to be an HTTPS URI`() {
assertThatCode {
resolver.getBytes(
PackageAssetUri("package://localhost:12110/badPackageZipUrl@1.0.0#/Bug.pkl"),
PackageAssetUri("package://localhost:0/badPackageZipUrl@1.0.0#/Bug.pkl"),
false,
null)
}
.hasMessage("Expected the zip asset for package `package://localhost:12110/badPackageZipUrl@1.0.0` to be an HTTPS URI, but got `ftp://wait/a/minute`.")
.hasMessage("Expected the zip asset for package `package://localhost:0/badPackageZipUrl@1.0.0` to be an HTTPS URI, but got `ftp://wait/a/minute`.")
}
@Test
fun `throws if package checksum is invalid`() {
val error = assertThrows<PackageLoadError> {
resolver.getBytes(
PackageAssetUri("package://localhost:12110/badChecksum@1.0.0#/Bug.pkl"),
PackageAssetUri("package://localhost:0/badChecksum@1.0.0#/Bug.pkl"),
false,
null)
}

View File

@@ -46,23 +46,23 @@ class ProjectDependenciesResolverTest {
{
"schemaVersion": 1,
"resolvedDependencies": {
"package://localhost:12110/birds@0": {
"package://localhost:0/birds@0": {
"type": "remote",
"uri": "projectpackage://localhost:12110/birds@0.5.0",
"uri": "projectpackage://localhost:0/birds@0.5.0",
"checksums": {
"sha256": "0a5ad2dc13f06f73f96ba94e8d01d48252bc934e2de71a837620ca0fef8a7453"
"sha256": "${PackageServer.BIRDS_SHA}"
}
},
"package://localhost:12110/fruit@1": {
"package://localhost:0/fruit@1": {
"type": "remote",
"uri": "projectpackage://localhost:12110/fruit@1.1.0",
"uri": "projectpackage://localhost:0/fruit@1.1.0",
"checksums": {
"sha256": "a82e92e0c259591111d09d18a14f5ad66e2b6e13d827ee3e6f7ce06f5d0fbe0c"
"sha256": "${PackageServer.FRUIT_1_1_SHA}"
}
},
"package://localhost:12110/project3@1": {
"package://localhost:0/project3@1": {
"type": "local",
"uri": "projectpackage://localhost:12110/project3@1.5.0",
"uri": "projectpackage://localhost:0/project3@1.5.0",
"path": "../project3"
}
}
@@ -79,9 +79,9 @@ class ProjectDependenciesResolverTest {
ProjectDependenciesResolver(project, packageResolver, System.err.writer()).resolve()
}
assertThat(e).hasMessage("""
Computed checksum did not match declared checksum for dependency `package://localhost:12110/birds@0.5.0`.
Computed checksum did not match declared checksum for dependency `package://localhost:0/birds@0.5.0`.
Computed: "0a5ad2dc13f06f73f96ba94e8d01d48252bc934e2de71a837620ca0fef8a7453"
Computed: "${PackageServer.BIRDS_SHA}"
Declared: "intentionally bogus value"
""".trimIndent())
}

View File

@@ -14,16 +14,16 @@ class ProjectDepsTest {
{
"schemaVersion": 1,
"resolvedDependencies": {
"package://localhost:12110/birds@0": {
"package://localhost:0/birds@0": {
"type": "remote",
"uri": "package://localhost:12110/birds@0.5.0",
"uri": "package://localhost:0/birds@0.5.0",
"checksums": {
"sha256": "abc123"
}
},
"package://localhost:12110/fruit@1": {
"package://localhost:0/fruit@1": {
"type": "local",
"uri": "package://localhost:12110/fruit@1.1.0",
"uri": "package://localhost:0/fruit@1.1.0",
"path": "../fruit"
}
}
@@ -32,12 +32,12 @@ class ProjectDepsTest {
private val projectDeps = let {
val projectDepsMap = EconomicMaps.of<CanonicalPackageUri, Dependency>(
CanonicalPackageUri.of("package://localhost:12110/birds@0"), Dependency.RemoteDependency(
PackageUri.create("package://localhost:12110/birds@0.5.0"),
CanonicalPackageUri.of("package://localhost:0/birds@0"), Dependency.RemoteDependency(
PackageUri.create("package://localhost:0/birds@0.5.0"),
Checksums("abc123")
),
CanonicalPackageUri.of("package://localhost:12110/fruit@1"), Dependency.LocalDependency(
PackageUri.create("package://localhost:12110/fruit@1.1.0"),
CanonicalPackageUri.of("package://localhost:0/fruit@1"), Dependency.LocalDependency(
PackageUri.create("package://localhost:0/fruit@1.1.0"),
Path.of("../fruit")
)
)

View File

@@ -151,11 +151,11 @@ class ProjectTest {
assertThatCode { evaluator.evaluate(ModuleSource.path(projectDir.resolve("bug.pkl"))) }
.hasMessageStartingWith("""
Pkl Error
Cannot download package `package://localhost:12110/fruit@1.0.5` because the computed checksum for package metadata does not match the expected checksum.
Cannot download package `package://localhost:0/fruit@1.0.5` because the computed checksum for package metadata does not match the expected checksum.
Computed checksum: "abd173e8a25f5b930b0e34269a441e32c9d95e0b0a715bc6eff918f0afd0688e"
Computed checksum: "${PackageServer.FRUIT_SHA}"
Expected checksum: "intentionally bogus checksum"
Asset URL: "https://localhost:12110/fruit@1.0.5"
Asset URL: "https://localhost:0/fruit@1.0.5"
1 | import "@fruit/Fruit.pkl"
^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@@ -2,7 +2,7 @@ amends "pkl:Project"
dependencies {
["birds"] {
uri = "package://localhost:12110/birds@0.5.0"
uri = "package://localhost:0/birds@0.5.0"
checksums {
sha256 = "intentionally bogus value"
}

View File

@@ -3,6 +3,6 @@ amends "pkl:Project"
dependencies {
["fruit"] {
// should fail because the checksum is invalid
uri = "package://localhost:12110/fruit@1.0.5"
uri = "package://localhost:0/fruit@1.0.5"
}
}

View File

@@ -1,9 +1,9 @@
{
"schemaVersion": 1,
"resolvedDependencies": {
"package://localhost:12110/fruit@1": {
"package://localhost:0/fruit@1": {
"type": "remote",
"uri": "projectpackage://localhost:12110/fruit@1.0.5",
"uri": "projectpackage://localhost:0/fruit@1.0.5",
"checksums": {
"sha256": "intentionally bogus checksum"
}

View File

@@ -2,7 +2,7 @@ amends "pkl:Project"
dependencies {
["birds"] {
uri = "package://localhost:12110/birds@0.5.0"
uri = "package://localhost:0/birds@0.5.0"
}
["project3"] = import("../project3/PklProject")
}

View File

@@ -2,7 +2,7 @@ amends "pkl:Project"
package {
name = "project3"
baseUri = "package://localhost:12110/project3"
baseUri = "package://localhost:0/project3"
version = "1.5.0"
// not actually used, just need to provide one so tests pass
packageZipUrl = "https://bogus.value"
@@ -10,6 +10,6 @@ package {
dependencies {
["fruit"] {
uri = "package://localhost:12110/fruit@1.1.0"
uri = "package://localhost:0/fruit@1.1.0"
}
}

View File

@@ -4,5 +4,5 @@ package {
name = "project4"
version = "1.0.0"
packageZipUrl = "https://bogus.value"
baseUri = "package://localhost:12110/project4"
baseUri = "package://localhost:0/project4"
}