From 01e37824a84155cba143bdb0559e03e87cfbdae4 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 20 May 2024 18:12:24 -0700 Subject: [PATCH] Start CoreTests and add to test plans. --- .../xcshareddata/xcschemes/CoreTests.xcscheme | 54 +++++++++++++++++++ Core/Tests/CoreTests/CoreTests.swift | 12 ----- .../Tests/CoreTests/MacroProcessorTests.swift | 22 ++++++++ Mac.xctestplan | 8 +++ iOS.xctestplan | 16 ++++++ 5 files changed, 100 insertions(+), 12 deletions(-) create mode 100644 Core/.swiftpm/xcode/xcshareddata/xcschemes/CoreTests.xcscheme delete mode 100644 Core/Tests/CoreTests/CoreTests.swift create mode 100644 Core/Tests/CoreTests/MacroProcessorTests.swift diff --git a/Core/.swiftpm/xcode/xcshareddata/xcschemes/CoreTests.xcscheme b/Core/.swiftpm/xcode/xcshareddata/xcschemes/CoreTests.xcscheme new file mode 100644 index 000000000..e95468313 --- /dev/null +++ b/Core/.swiftpm/xcode/xcshareddata/xcschemes/CoreTests.xcscheme @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Core/Tests/CoreTests/CoreTests.swift b/Core/Tests/CoreTests/CoreTests.swift deleted file mode 100644 index 3cad2b63f..000000000 --- a/Core/Tests/CoreTests/CoreTests.swift +++ /dev/null @@ -1,12 +0,0 @@ -import XCTest -@testable import Core - -final class CoreTests: XCTestCase { - func testExample() throws { - // XCTest Documentation - // https://developer.apple.com/documentation/xctest - - // Defining Test Cases and Test Methods - // https://developer.apple.com/documentation/xctest/defining_test_cases_and_test_methods - } -} diff --git a/Core/Tests/CoreTests/MacroProcessorTests.swift b/Core/Tests/CoreTests/MacroProcessorTests.swift new file mode 100644 index 000000000..a3feae0e7 --- /dev/null +++ b/Core/Tests/CoreTests/MacroProcessorTests.swift @@ -0,0 +1,22 @@ +// +// MacroProcessorTests.swift +// +// +// Created by Brent Simmons on 5/20/24. +// + +import XCTest +import Core + +final class MacroProcessorTests: XCTestCase { + + func testOneMacro() { + + let template = "{content}" + let substitutions = ["content": "This is the content."] + + let renderedText = try! MacroProcessor.renderedText(withTemplate: template, substitutions: substitutions, macroStart: "{", macroEnd: "}") + let expectedText = "This is the content." + XCTAssertEqual(renderedText, expectedText) + } +} diff --git a/Mac.xctestplan b/Mac.xctestplan index 28bb4dbf3..11dd5c2a0 100644 --- a/Mac.xctestplan +++ b/Mac.xctestplan @@ -43,6 +43,14 @@ "identifier" : "TreeTests", "name" : "TreeTests" } + }, + { + "parallelizable" : true, + "target" : { + "containerPath" : "container:", + "identifier" : "CoreTests", + "name" : "CoreTests" + } } ], "version" : 1 diff --git a/iOS.xctestplan b/iOS.xctestplan index 93133c525..295898531 100644 --- a/iOS.xctestplan +++ b/iOS.xctestplan @@ -19,6 +19,22 @@ "identifier" : "FoundationExtrasTests", "name" : "FoundationExtrasTests" } + }, + { + "parallelizable" : true, + "target" : { + "containerPath" : "container:", + "identifier" : "CoreTests", + "name" : "CoreTests" + } + }, + { + "parallelizable" : true, + "target" : { + "containerPath" : "container:..\/Tree", + "identifier" : "TreeTests", + "name" : "TreeTests" + } } ], "version" : 1