Documented the String+Constants extension in the library target.

This commit is contained in:
Javier Cicchelli 2025-03-07 22:14:25 +01:00
parent 9154009f6e
commit 765ab9c778
4 changed files with 13 additions and 1 deletions

View File

@ -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 = ".."
}

View File

@ -1,4 +1,4 @@
/// A type that can provide a relative path representation. /// A protocol that provides a relative path representation.
protocol Pathable { protocol Pathable {
// MARK: Properties // MARK: Properties

View File

@ -5,6 +5,8 @@ import Testing
@Suite("IndexPrefix", .tags(.enumeration)) @Suite("IndexPrefix", .tags(.enumeration))
struct IndexPrefixTests { struct IndexPrefixTests {
// MARK: Properties tests
@Test(arguments: zip(IndexPrefix.allCases, [String].paths)) @Test(arguments: zip(IndexPrefix.allCases, [String].paths))
func path( func path(
for prefix: IndexPrefix, for prefix: IndexPrefix,

View File

@ -5,6 +5,8 @@ import Testing
@Suite("StaticFile", .tags(.enumeration)) @Suite("StaticFile", .tags(.enumeration))
struct StaticFileTests { struct StaticFileTests {
// MARK: Properties tests
@Test(arguments: zip(StaticFile.allCases, [String].paths)) @Test(arguments: zip(StaticFile.allCases, [String].paths))
func path( func path(
for prefix: StaticFile, for prefix: StaticFile,