From ec3b09a288faee817bcceb8f715a87dfb49845dc Mon Sep 17 00:00:00 2001 From: Cameron Pulsford Date: Thu, 8 Aug 2024 21:04:49 -0400 Subject: [PATCH] Xcode 16 beta 5: look up macros from current test trait --- Sources/MacroTesting/AssertMacro.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/MacroTesting/AssertMacro.swift b/Sources/MacroTesting/AssertMacro.swift index 855f477..6095bb8 100644 --- a/Sources/MacroTesting/AssertMacro.swift +++ b/Sources/MacroTesting/AssertMacro.swift @@ -134,7 +134,11 @@ public func assertMacro( let record = record ?? SnapshotTestingConfiguration.current?.record #endif withSnapshotTesting(record: record) { - let macros = macros ?? MacroTestingConfiguration.current.macros + #if canImport(Testing) + let macros = macros ?? MacroTestingConfiguration.current.macros ?? Test.current?.macros + #else + let macros = macros ?? MacroTestingConfiguration.current.macros + #endif guard let macros, !macros.isEmpty else { recordIssue( """