Removed the "app", "appTests", and "package" cases from the File enumeration in the library target.

This commit is contained in:
2025-02-05 00:16:09 +01:00
parent 91762b18cd
commit af73e6d1a2
6 changed files with 67 additions and 122 deletions
@@ -53,45 +53,37 @@ struct FileTests {
private extension FileTests {
enum Expectation {
static let fileNames: [String] = [
"App.swift",
"AppArguments.swift",
"AppBuilder.swift",
"AppOptions.swift",
"AppTests.swift",
"Dockerfile",
".dockerignore",
"Environment+Properties.swift",
".gitignore",
"LICENSE",
"LoggerLevel+Conformances.swift",
"Package.swift",
"README.md",
"TestArguments.swift"
]
static let filePaths: [String] = [
"App/Sources/App.swift",
"Library/Sources/Public/AppArguments.swift",
"Library/Sources/Public/AppBuilder.swift",
"App/Sources/AppOptions.swift",
"Test/Sources/Cases/Public/AppTests.swift",
"Dockerfile",
".dockerignore",
"Library/Sources/Internal/Environment+Properties.swift",
".gitignore",
"LICENSE",
"Library/Sources/Internal/LoggerLevel+Conformances.swift",
"Package.swift",
"README.md",
"Test/Sources/Helpers/TestArguments.swift"
]
static let folders: [Folder] = [
.app,
.libraryPublic,
.libraryPublic,
.app,
.testCasesPublic,
.root,
.root,
.libraryInternal,
@@ -99,17 +91,13 @@ private extension FileTests {
.root,
.libraryInternal,
.root,
.root,
.testHelpers
]
static let resourcePaths: [String] = [
"Resources/Files/Sources/App",
"Resources/Files/Sources/Library",
"Resources/Files/Sources/Library",
"Resources/Files/Sources/App",
"Resources/Files/Sources/Test",
"Resources/Files/Sources",
"Resources/Files/Sources",
"Resources/Files/Sources/Library",
@@ -117,9 +105,7 @@ private extension FileTests {
"Resources/Files/Sources",
"Resources/Files/Sources/Library",
"Resources/Files/Sources",
"Resources/Files/Sources",
"Resources/Files/Sources/Test"
]
}
}
@@ -0,0 +1,64 @@
import Testing
@testable import ColibriLibrary
struct TemplateTests {
// MARK: Properties tests
@Test(arguments: zip(Template.allCases, Expectation.fileNames))
func fileName(for template: Template, expects fileName: String) async throws {
// GIVEN
// WHEN
let result = template.fileName
// THEN
#expect(result == fileName)
}
@Test(arguments: zip(Template.allCases, Expectation.filePaths))
func filePath(for template: Template, expects filePath: String) async throws {
// GIVEN
// WHEN
let result = template.filePath
// THEN
#expect(result == filePath)
}
@Test(arguments: zip(Template.allCases, Expectation.folders))
func folder(for template: Template, expects folder: Folder) async throws {
// GIVEN
// WHEN
let result = template.folder
// THEN
#expect(result == folder)
}
}
// MARK: - Expectations
private extension TemplateTests {
enum Expectation {
static let fileNames: [String] = [
"App.swift",
"AppTests.swift",
"Package.swift",
]
static let filePaths: [String] = [
"App/Sources/App.swift",
"Test/Sources/Cases/Public/AppTests.swift",
"Package.swift",
]
static let folders: [Folder] = [
.app,
.testCasesPublic,
.root,
]
}
}