File tree Expand file tree Collapse file tree 8 files changed +11
-27
lines changed Expand file tree Collapse file tree 8 files changed +11
-27
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,7 @@ import CompilerPluginSupport
77let package = Package (
88 name: " SwiftMacros " ,
99 platforms: [
10- . macOS( . v12) ,
11- . iOS( . v13)
10+ . macOS( . v12)
1211 ] ,
1312 products: [
1413 . library(
@@ -38,7 +37,7 @@ let package = Package(
3837 . testTarget(
3938 name: " MacroTests " ,
4039 dependencies: [
41- " SwiftMacros " ,
40+ " Macros " ,
4241 . product( name: " SwiftSyntaxMacrosTestSupport " , package : " swift-syntax " )
4342 ]
4443 )
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ import SwiftSyntax
22import SwiftSyntaxBuilder
33import SwiftSyntaxMacros
44
5- public struct AssociatedValuesMacro : MemberMacro {
6- public static func expansion(
5+ struct AssociatedValuesMacro : MemberMacro {
6+ static func expansion(
77 of node: AttributeSyntax ,
88 providingMembersOf declaration: some DeclGroupSyntax ,
99 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.
61import SwiftSyntax
72import SwiftSyntaxBuilder
83import SwiftSyntaxMacros
94
10- public struct SingletonMacro : MemberMacro {
11- public static func expansion(
5+ struct SingletonMacro : MemberMacro {
6+ static func expansion(
127 of node: AttributeSyntax ,
138 providingMembersOf declaration: some DeclGroupSyntax ,
149 in context: some MacroExpansionContext
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ import SwiftSyntaxMacros
22import SwiftSyntax
33import SwiftUI
44
5- public struct SymbolMacro : ExpressionMacro {
6- public static func expansion(
5+ struct SymbolMacro : ExpressionMacro {
6+ static func expansion(
77 of node: some FreestandingMacroExpansionSyntax ,
88 in context: some MacroExpansionContext
99 ) throws -> ExprSyntax {
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ import SwiftSyntaxMacros
22import SwiftSyntax
33import Foundation
44
5- public struct URLMacro : ExpressionMacro {
6- public static func expansion(
5+ struct URLMacro : ExpressionMacro {
6+ static func expansion(
77 of node: some FreestandingMacroExpansionSyntax ,
88 in context: some MacroExpansionContext
99 ) throws -> ExprSyntax {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import Foundation
22import SwiftSyntaxMacros
33
44#if canImport(Macros)
5- import Macros
5+ @ testable import Macros
66
77let testMacros : [ String : Macro . Type ] = [
88 " symbol " : SymbolMacro . self,
Original file line number Diff line number Diff line change 11import SwiftSyntaxMacros
22import SwiftSyntaxMacrosTestSupport
33import XCTest
4- @testable import SwiftMacros
54
65final class SymbolMacroTests : XCTestCase {
7- func testUsage( ) {
8- XCTAssertEqual ( #symbol( " swift " ) , " swift " )
9- }
10-
116 func testValidSymbol( ) throws {
127 #if canImport(Macros)
138 assertMacroExpansion (
Original file line number Diff line number Diff line change 11import SwiftSyntaxMacros
22import SwiftSyntaxMacrosTestSupport
33import XCTest
4- @testable import SwiftMacros
54
65final class URLMacroTests : XCTestCase {
7- func testUsage( ) {
8- XCTAssertEqual ( #URL( " http://localhost " ) , URL ( string: " http://localhost " ) !)
9- }
10-
116 func testValidURL( ) throws {
127 #if canImport(Macros)
138 assertMacroExpansion (
You can’t perform that action at this time.
0 commit comments