File tree 8 files changed +11
-27
lines changed
8 files changed +11
-27
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,7 @@ import CompilerPluginSupport
7
7
let package = Package (
8
8
name: " SwiftMacros " ,
9
9
platforms: [
10
- . macOS( . v12) ,
11
- . iOS( . v13)
10
+ . macOS( . v12)
12
11
] ,
13
12
products: [
14
13
. library(
@@ -38,7 +37,7 @@ let package = Package(
38
37
. testTarget(
39
38
name: " MacroTests " ,
40
39
dependencies: [
41
- " SwiftMacros " ,
40
+ " Macros " ,
42
41
. product( name: " SwiftSyntaxMacrosTestSupport " , package : " swift-syntax " )
43
42
]
44
43
)
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ import SwiftSyntax
2
2
import SwiftSyntaxBuilder
3
3
import SwiftSyntaxMacros
4
4
5
- public struct AssociatedValuesMacro : MemberMacro {
6
- public static func expansion(
5
+ struct AssociatedValuesMacro : MemberMacro {
6
+ static func expansion(
7
7
of node: AttributeSyntax ,
8
8
providingMembersOf declaration: some DeclGroupSyntax ,
9
9
in context: some MacroExpansionContext
Original file line number Diff line number Diff line change 1
- //
2
- // File.swift
3
- //
4
- //
5
- // Created by Andrea on 24/11/23.
6
1
import SwiftSyntax
7
2
import SwiftSyntaxBuilder
8
3
import SwiftSyntaxMacros
9
4
10
- public struct SingletonMacro : MemberMacro {
11
- public static func expansion(
5
+ struct SingletonMacro : MemberMacro {
6
+ static func expansion(
12
7
of node: AttributeSyntax ,
13
8
providingMembersOf declaration: some DeclGroupSyntax ,
14
9
in context: some MacroExpansionContext
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ import SwiftSyntaxMacros
2
2
import SwiftSyntax
3
3
import SwiftUI
4
4
5
- public struct SymbolMacro : ExpressionMacro {
6
- public static func expansion(
5
+ struct SymbolMacro : ExpressionMacro {
6
+ static func expansion(
7
7
of node: some FreestandingMacroExpansionSyntax ,
8
8
in context: some MacroExpansionContext
9
9
) throws -> ExprSyntax {
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ import SwiftSyntaxMacros
2
2
import SwiftSyntax
3
3
import Foundation
4
4
5
- public struct URLMacro : ExpressionMacro {
6
- public static func expansion(
5
+ struct URLMacro : ExpressionMacro {
6
+ static func expansion(
7
7
of node: some FreestandingMacroExpansionSyntax ,
8
8
in context: some MacroExpansionContext
9
9
) throws -> ExprSyntax {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import Foundation
2
2
import SwiftSyntaxMacros
3
3
4
4
#if canImport(Macros)
5
- import Macros
5
+ @ testable import Macros
6
6
7
7
let testMacros : [ String : Macro . Type ] = [
8
8
" symbol " : SymbolMacro . self,
Original file line number Diff line number Diff line change 1
1
import SwiftSyntaxMacros
2
2
import SwiftSyntaxMacrosTestSupport
3
3
import XCTest
4
- @testable import SwiftMacros
5
4
6
5
final class SymbolMacroTests : XCTestCase {
7
- func testUsage( ) {
8
- XCTAssertEqual ( #symbol( " swift " ) , " swift " )
9
- }
10
-
11
6
func testValidSymbol( ) throws {
12
7
#if canImport(Macros)
13
8
assertMacroExpansion (
Original file line number Diff line number Diff line change 1
1
import SwiftSyntaxMacros
2
2
import SwiftSyntaxMacrosTestSupport
3
3
import XCTest
4
- @testable import SwiftMacros
5
4
6
5
final class URLMacroTests : XCTestCase {
7
- func testUsage( ) {
8
- XCTAssertEqual ( #URL( " http://localhost " ) , URL ( string: " http://localhost " ) !)
9
- }
10
-
11
6
func testValidURL( ) throws {
12
7
#if canImport(Macros)
13
8
assertMacroExpansion (
You can’t perform that action at this time.
0 commit comments