From 765ab9c778873f96a0f41604f40783132f4df6f4 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Fri, 7 Mar 2025 22:14:25 +0100 Subject: [PATCH] Documented the String+Constants extension in the library target. --- .../Sources/Internal/Extensions/String+Constants.swift | 8 ++++++++ Library/Sources/Internal/Protocols/Pathable.swift | 2 +- .../Cases/Internal/Enumerations/IndexPrefixTests.swift | 2 ++ .../Cases/Internal/Enumerations/StaticFileTests.swift | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 Library/Sources/Internal/Extensions/String+Constants.swift diff --git a/Library/Sources/Internal/Extensions/String+Constants.swift b/Library/Sources/Internal/Extensions/String+Constants.swift new file mode 100644 index 0000000..2841f37 --- /dev/null +++ b/Library/Sources/Internal/Extensions/String+Constants.swift @@ -0,0 +1,8 @@ +extension String { + /// A representation of an empty string. + static let empty = "" + /// A representation of a string containing solely a forwarding slash. + static let forwardSlash = "/" + /// A representation of a string that identifies a previous folder in a path component. + static let previousFolder = ".." +} diff --git a/Library/Sources/Internal/Protocols/Pathable.swift b/Library/Sources/Internal/Protocols/Pathable.swift index 75e1646..d84a6f4 100644 --- a/Library/Sources/Internal/Protocols/Pathable.swift +++ b/Library/Sources/Internal/Protocols/Pathable.swift @@ -1,4 +1,4 @@ -/// A type that can provide a relative path representation. +/// A protocol that provides a relative path representation. protocol Pathable { // MARK: Properties diff --git a/Test/Sources/Cases/Internal/Enumerations/IndexPrefixTests.swift b/Test/Sources/Cases/Internal/Enumerations/IndexPrefixTests.swift index e1c6613..435f497 100644 --- a/Test/Sources/Cases/Internal/Enumerations/IndexPrefixTests.swift +++ b/Test/Sources/Cases/Internal/Enumerations/IndexPrefixTests.swift @@ -5,6 +5,8 @@ import Testing @Suite("IndexPrefix", .tags(.enumeration)) struct IndexPrefixTests { + // MARK: Properties tests + @Test(arguments: zip(IndexPrefix.allCases, [String].paths)) func path( for prefix: IndexPrefix, diff --git a/Test/Sources/Cases/Internal/Enumerations/StaticFileTests.swift b/Test/Sources/Cases/Internal/Enumerations/StaticFileTests.swift index 5bd1425..a0a2cb8 100644 --- a/Test/Sources/Cases/Internal/Enumerations/StaticFileTests.swift +++ b/Test/Sources/Cases/Internal/Enumerations/StaticFileTests.swift @@ -5,6 +5,8 @@ import Testing @Suite("StaticFile", .tags(.enumeration)) struct StaticFileTests { + // MARK: Properties tests + @Test(arguments: zip(StaticFile.allCases, [String].paths)) func path( for prefix: StaticFile,