35 lines
617 B
Swift
35 lines
617 B
Swift
|
import Testing
|
||
|
|
||
|
@testable import AppLibrary
|
||
|
|
||
|
@Suite("IndexPrefix")
|
||
|
struct IndexPrefixTests {
|
||
|
|
||
|
@Test(arguments: zip(IndexPrefix.allCases, [String].paths))
|
||
|
func path(
|
||
|
for prefix: IndexPrefix,
|
||
|
expects pathExpected: String
|
||
|
) async throws {
|
||
|
// GIVEN
|
||
|
// WHEN
|
||
|
let path = prefix.path
|
||
|
|
||
|
// THEN
|
||
|
#expect(path == pathExpected)
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
// MARK: - Collection+Strings
|
||
|
|
||
|
private extension Collection where Element == String {
|
||
|
|
||
|
// MARK: Properties
|
||
|
|
||
|
static var paths: [Element] {[
|
||
|
"/documentation",
|
||
|
"/tutorials"
|
||
|
]}
|
||
|
|
||
|
}
|