Fixed the percent encoding for the "pathString" computed property of the URL+Extensions extension in the library target.
This commit is contained in:
parent
6a3b9b5141
commit
0079820222
@ -16,7 +16,7 @@ extension URL {
|
|||||||
|
|
||||||
var pathString: String {
|
var pathString: String {
|
||||||
if #available(macOS 13.0, *) {
|
if #available(macOS 13.0, *) {
|
||||||
path(percentEncoded: true)
|
path(percentEncoded: false)
|
||||||
} else {
|
} else {
|
||||||
path
|
path
|
||||||
}
|
}
|
||||||
|
@ -24,8 +24,8 @@ struct URL_ExtensionsTests {
|
|||||||
|
|
||||||
// MARK: Computed tests
|
// MARK: Computed tests
|
||||||
|
|
||||||
@Test(arguments: zip([URL.someFile, .dotFile, .tildeFile, .someURL],
|
@Test(arguments: zip([URL.someFile, .dotFile, .tildeFile, .someEncodedFile, .someURL],
|
||||||
[String.someFilePath, .dotPath, .tildePath, .empty]))
|
[String.someFilePath, .dotPath, .tildePath, .someEncodedPath, .empty]))
|
||||||
func pathString(
|
func pathString(
|
||||||
with url: URL,
|
with url: URL,
|
||||||
expects path: String
|
expects path: String
|
||||||
@ -63,6 +63,7 @@ private extension String {
|
|||||||
static let dotPath = "."
|
static let dotPath = "."
|
||||||
static let empty = ""
|
static let empty = ""
|
||||||
static let tildePath = "~"
|
static let tildePath = "~"
|
||||||
|
static let someEncodedPath = "/sömê/páth/fîlê"
|
||||||
static let someFilePath = "/some/file/path"
|
static let someFilePath = "/some/file/path"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,6 +71,7 @@ private extension String {
|
|||||||
|
|
||||||
private extension URL {
|
private extension URL {
|
||||||
static let dotFile = URL(at: .dotPath)
|
static let dotFile = URL(at: .dotPath)
|
||||||
|
static let someEncodedFile = URL(at: "/sömê/páth/fîlê")
|
||||||
static let someFile = URL(at: .someFilePath)
|
static let someFile = URL(at: .someFilePath)
|
||||||
static let someURL = URL(string: "https://some.url.path")!
|
static let someURL = URL(string: "https://some.url.path")!
|
||||||
static let tildeFile = URL(at: .tildePath)
|
static let tildeFile = URL(at: .tildePath)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user