-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
56 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Sources/TestCasesMacro/TestCasesMacro.swift → Sources/TestCaseKit/TestCaseMacro.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
@attached(peer, names: arbitrary) | ||
public macro testCase<each T>(_: repeat each T) = #externalMacro(module: "TestCasesMacroMacros", type: "TestCaseMacro") | ||
public macro testCase<each T>(_: repeat each T) = #externalMacro(module: "TestCaseKitMacros", type: "TestCaseMacro") |
2 changes: 1 addition & 1 deletion
2
Sources/TestCasesMacroClient/main.swift → Sources/TestCaseKitClient/main.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import TestCasesMacro | ||
import TestCaseKit | ||
|
||
|
||
class Example { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// TestCasesRealCodeTests.swift | ||
// | ||
// | ||
// Created by Alim Yuzbashev on 26.10.2023. | ||
// | ||
|
||
import XCTest | ||
import TestCaseKit | ||
|
||
final class TestCasesRealCodeTests: XCTestCase { | ||
|
||
@testCase(3, 1, 4) | ||
@testCase(5, 3, 8) | ||
@testCase(6, 12, 18) | ||
func testRealCodeMacroSum(_ lhs: Int, _ rhs: Int, _ result: Int) { | ||
XCTAssertEqual(lhs + rhs, result) | ||
} | ||
|
||
@testCase("1", "1", "11") | ||
@testCase("5", "3", "53") | ||
@testCase("6", "12", "612") | ||
func testRealCodeMacroSumStrings(_ lhs: String, _ rhs: String, _ result: String) { | ||
XCTAssertEqual(lhs + rhs, result) | ||
} | ||
|
||
@testCase(nil as String?) | ||
func testRealCodeMacroOptional(_ x: String?) { | ||
XCTAssertNil(x) | ||
} | ||
} |