You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Tests/PackageLoadingTests/PD_4_2_LoadingTests.swift
+36-16Lines changed: 36 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -497,23 +497,43 @@ class PackageDescription4_2LoadingTests: PackageDescriptionLoadingTests {
497
497
}
498
498
}
499
499
500
-
func testURLContainsNotAbsolutePath()throws{
501
-
letmanifest="""
502
-
import PackageDescription
503
-
let package = Package(
504
-
name: "Trivial",
505
-
dependencies: [
506
-
.package(url: "file://../best", from: "1.0.0"),
507
-
],
508
-
targets: [
509
-
.target(
510
-
name: "foo",
511
-
dependencies: []),
512
-
]
513
-
)
514
-
"""
500
+
func testFileURLsWithHostnames()throws{
501
+
enumExpectedError{
502
+
case relativePath
503
+
case unsupportedHostname
504
+
505
+
varmanifestError:ManifestParseError{
506
+
switchself{
507
+
case.relativePath:
508
+
return.invalidManifestFormat("file:// URLs cannot be relative, did you mean to use '.package(path:)'?", diagnosticFile:nil)
509
+
case.unsupportedHostname:
510
+
return.invalidManifestFormat("file:// URLs with hostnames are not supported, are you missing a '/'?", diagnosticFile:nil)
511
+
}
512
+
}
513
+
}
515
514
516
-
XCTAssertManifestLoadThrows(ManifestParseError.invalidManifestFormat("file:// URLs cannot be relative, did you mean to use `.package(path:)`?", diagnosticFile:nil), manifest)
515
+
leturls:[(String,ExpectedError)]=[
516
+
("file://../best",.relativePath), // Possible attempt at a relative path.
0 commit comments