1414// See the License for the specific language governing permissions and
1515// limitations under the License.
1616
17- import Testing
1817import FirebaseCore
1918@testable import FirebaseFirestore
19+ import Testing
2020
2121// MARK: - Shared Test Helpers
2222
@@ -119,7 +119,8 @@ private struct Swizzler: ~Copyable {
119119 Self . swizzle ( cls, originalSelector: swizzled, swizzledSelector: original)
120120 }
121121
122- private static func swizzle( _ cls: AnyClass , originalSelector: Selector , swizzledSelector: Selector ) {
122+ private static func swizzle( _ cls: AnyClass , originalSelector: Selector ,
123+ swizzledSelector: Selector ) {
123124 guard let originalMethod = class_getInstanceMethod ( cls, originalSelector) ,
124125 let swizzledMethod = class_getInstanceMethod ( cls, swizzledSelector) else {
125126 #expect( false , " Failed to get methods for swizzling " )
@@ -270,7 +271,8 @@ struct DocumentReferenceAsyncSequenceTests {
270271 let swizzler = Swizzler (
271272 DocumentReference . self,
272273 original: #selector( DocumentReference . addSnapshotListener ( includeMetadataChanges: listener: ) ) ,
273- swizzled: #selector( DocumentReference . swizzled_addSnapshotListener ( includeMetadataChanges: listener: ) )
274+ swizzled: #selector( DocumentReference
275+ . swizzled_addSnapshotListener ( includeMetadataChanges: listener: ) )
274276 )
275277 defer { withExtendedLifetime ( swizzler) { } }
276278
@@ -299,7 +301,8 @@ struct DocumentReferenceAsyncSequenceTests {
299301 let swizzler = Swizzler (
300302 DocumentReference . self,
301303 original: #selector( DocumentReference . addSnapshotListener ( includeMetadataChanges: listener: ) ) ,
302- swizzled: #selector( DocumentReference . swizzled_addSnapshotListener ( includeMetadataChanges: listener: ) )
304+ swizzled: #selector( DocumentReference
305+ . swizzled_addSnapshotListener ( includeMetadataChanges: listener: ) )
303306 )
304307 defer { withExtendedLifetime ( swizzler) { } }
305308
@@ -334,7 +337,8 @@ struct DocumentReferenceAsyncSequenceTests {
334337 let swizzler = Swizzler (
335338 DocumentReference . self,
336339 original: #selector( DocumentReference . addSnapshotListener ( includeMetadataChanges: listener: ) ) ,
337- swizzled: #selector( DocumentReference . swizzled_addSnapshotListener ( includeMetadataChanges: listener: ) )
340+ swizzled: #selector( DocumentReference
341+ . swizzled_addSnapshotListener ( includeMetadataChanges: listener: ) )
338342 )
339343 defer { withExtendedLifetime ( swizzler) { } }
340344
@@ -364,10 +368,9 @@ struct DocumentReferenceAsyncSequenceTests {
364368// MARK: - Method Swizzling
365369
366370extension Query {
367- @objc func swizzled_addSnapshotListener(
368- includeMetadataChanges: Bool ,
369- listener: @escaping ( QuerySnapshot ? , Error ? ) -> Void
370- ) -> ListenerRegistration {
371+ @objc func swizzled_addSnapshotListener( includeMetadataChanges: Bool ,
372+ listener: @escaping ( QuerySnapshot ? , Error ? ) -> Void )
373+ -> ListenerRegistration {
371374 let key = Unmanaged . passUnretained ( QueryAsyncSequenceTests . associationKey) . toOpaque ( )
372375 let actor = objc_getAssociatedObject ( self , key) as! TestStateActor < QuerySnapshot >
373376 let registration = MockListenerRegistration ( actor : actor )
@@ -380,11 +383,11 @@ extension Query {
380383}
381384
382385extension DocumentReference {
383- @objc func swizzled_addSnapshotListener(
384- includeMetadataChanges : Bool ,
385- listener : @escaping ( DocumentSnapshot ? , Error ? ) -> Void
386- ) -> ListenerRegistration {
387- let key = Unmanaged . passUnretained ( DocumentReferenceAsyncSequenceTests . associationKey ) . toOpaque ( )
386+ @objc func swizzled_addSnapshotListener( includeMetadataChanges : Bool ,
387+ listener : @escaping ( DocumentSnapshot ? , Error ? ) -> Void )
388+ -> ListenerRegistration {
389+ let key = Unmanaged . passUnretained ( DocumentReferenceAsyncSequenceTests . associationKey )
390+ . toOpaque ( )
388391 let actor = objc_getAssociatedObject ( self , key) as! TestStateActor < DocumentSnapshot >
389392 let registration = MockListenerRegistration ( actor : actor )
390393 let wrapper = SendableListenerWrapper ( listener)
0 commit comments