From 5b379fbc861910cf36c21a4b6c5ee0c72964dbb6 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Sat, 8 Mar 2025 12:26:11 +0100 Subject: [PATCH] Fixed the output of the "path" computed property for the AssetPrefix enumeration in the library target. --- .../Internal/Enumerations/AssetPrefix.swift | 2 +- .../Internal/Extensions/String+Formats.swift | 10 ++++++---- .../Internal/Enumerations/AssetPrefixTests.swift | 16 ++++++++-------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Library/Sources/Internal/Enumerations/AssetPrefix.swift b/Library/Sources/Internal/Enumerations/AssetPrefix.swift index 621859e..c358b80 100644 --- a/Library/Sources/Internal/Enumerations/AssetPrefix.swift +++ b/Library/Sources/Internal/Enumerations/AssetPrefix.swift @@ -25,7 +25,7 @@ extension AssetPrefix: Pathable { // MARK: Computed var path: String { - .init(format: .Format.Path.root, rawValue) + .init(format: .Format.Path.folder, rawValue) } } diff --git a/Library/Sources/Internal/Extensions/String+Formats.swift b/Library/Sources/Internal/Extensions/String+Formats.swift index e64d658..fddf08a 100644 --- a/Library/Sources/Internal/Extensions/String+Formats.swift +++ b/Library/Sources/Internal/Extensions/String+Formats.swift @@ -3,13 +3,15 @@ extension String { enum Format { /// A namespace that defines the format patterns used to generate relative path representations. enum Path { - /// A representation of the format pattern used to generate relative paths that starts with the `/` string and finishes with the `.doccarchive` string. + /// A format pattern used to generate relative paths that starts with the `/` string and finishes with the `.doccarchive` string. static let archive = "/%@.doccarchive" - /// A representation of the format pattern used to generate relative paths that starts with the `/data` string. + /// A format pattern used to generate relative paths that starts with the `/data` string. static let data = "/data/%@" - /// A representation of the format pattern used to generate relative paths that starts with the `/docs` string. + /// A format pattern used to generate relative paths that starts with the `/docs` string. static let docs = "/docs/%@" - /// A representation of the format pattern used to generate relative paths that starts with the `/` string. + /// A format pattern used to generate relative paths that starts and finishes with the `/` string. + static let folder = "/%@/" + /// A format pattern used to generate relative paths that starts with the `/` string. static let root = "/%@" } } diff --git a/Test/Sources/Cases/Internal/Enumerations/AssetPrefixTests.swift b/Test/Sources/Cases/Internal/Enumerations/AssetPrefixTests.swift index 43f39e8..c1db3fa 100644 --- a/Test/Sources/Cases/Internal/Enumerations/AssetPrefixTests.swift +++ b/Test/Sources/Cases/Internal/Enumerations/AssetPrefixTests.swift @@ -29,14 +29,14 @@ private extension Collection where Element == String { // MARK: Properties static var paths: [Element] {[ - "/css", - "/data", - "/downloads", - "/images", - "/img", - "/index", - "/js", - "/videos" + "/css/", + "/data/", + "/downloads/", + "/images/", + "/img/", + "/index/", + "/js/", + "/videos/" ]} }