Basic project creation (#3)

This PR contains the work done to create a new *Hummingbird* project with very basic configuration from the _colibri_ executable, just like the project you could create with the [Hummingbird template](https://github.com/hummingbird-project/template) project in Github.

Reviewed-on: #3
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
This commit was merged in pull request #3.
This commit is contained in:
2025-01-28 00:07:24 +00:00
committed by Javier Cicchelli
parent b8c354e614
commit 9be8fa4a31
52 changed files with 1936 additions and 475 deletions
@@ -0,0 +1,125 @@
import Testing
@testable import ColibriLibrary
struct FileTests {
// MARK: Properties tests
@Test(arguments: zip(File.allCases, Expectation.fileNames))
func fileName(for file: File, expects fileName: String) async throws {
// GIVEN
// WHEN
let result = file.fileName
// THEN
#expect(result == fileName)
}
@Test(arguments: zip(File.allCases, Expectation.filePaths))
func filePath(for file: File, expects filePath: String) async throws {
// GIVEN
// WHEN
let result = file.filePath
// THEN
#expect(result == filePath)
}
@Test(arguments: zip(File.allCases, Expectation.folders))
func folder(for file: File, expects folder: Folder) async throws {
// GIVEN
// WHEN
let result = file.folder
// THEN
#expect(result == folder)
}
@Test(arguments: zip(File.allCases, Expectation.resourcePaths))
func resourcePath(for file: File, expects resourcePath: String) async throws {
// GIVEN
// WHEN
let result = file.resourcePath
// THEN
#expect(result == resourcePath)
}
}
// MARK: - Expectations
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,
.root,
.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",
"Resources/Files/Sources",
"Resources/Files/Sources",
"Resources/Files/Sources/Library",
"Resources/Files/Sources",
"Resources/Files/Sources",
"Resources/Files/Sources/Test"
]
}
}
@@ -0,0 +1,35 @@
import Testing
@testable import ColibriLibrary
struct FolderTests {
// MARK: Properties tests
@Test(arguments: zip(Folder.allCasesWithRoot, Expectation.paths))
func paths(for folder: Folder, expects path: String) async throws {
// GIVEN
// WHEN
let result = folder.path
// THEN
#expect(result == path)
}
}
// MARK: - Expectations
private extension FolderTests {
enum Expectation {
static let paths: [String] = [
"",
"App/Sources/",
"Library/Sources/Public/",
"Library/Sources/Internal/",
"Test/Sources/Cases/Public/",
"Test/Sources/Cases/Internal/",
"Test/Sources/Helpers/"
]
}
}