Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: resolve swiftformat errors and warnings in test modules #3854

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion AmplifyTestApp/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import UIKit

@UIApplicationMain
@main
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?
Expand Down
16 changes: 10 additions & 6 deletions AmplifyTestCommon/Helpers/AmplifyAssertions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import XCTest

@testable import CwlPreconditionTesting

public func XCTAssertThrowFatalError(_ expression: @escaping () -> Void,
file: StaticString = #file,
line: UInt = #line) throws {
public func XCTAssertThrowFatalError(
_ expression: @escaping () -> Void,
file: StaticString = #file,
line: UInt = #line
) throws {
#if (os(iOS) || os(macOS)) && (arch(arm64) || arch(x86_64))
var reached = false
let exception = catchBadInstruction {
Expand All @@ -26,9 +28,11 @@ public func XCTAssertThrowFatalError(_ expression: @escaping () -> Void,
#endif
}

public func XCTAssertNoThrowFatalError(_ expression: @escaping () -> Void,
file: StaticString = #file,
line: UInt = #line) throws {
public func XCTAssertNoThrowFatalError(
_ expression: @escaping () -> Void,
file: StaticString = #file,
line: UInt = #line
) throws {
#if (os(iOS) || os(macOS)) && (arch(arm64) || arch(x86_64))
var reached = false
let exception = catchBadInstruction {
Expand Down
2 changes: 1 addition & 1 deletion AmplifyTestCommon/Helpers/AuthSignInHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Amplify

public typealias CompletionType = (Bool, AuthError?) -> Void

public struct AuthSignInHelper {
public enum AuthSignInHelper {

public static func signUpUser(username: String, password: String, email: String) async throws -> AuthSignUpResult {
let options = AuthSignUpRequest.Options(userAttributes: [AuthUserAttribute(.email, value: email)])
Expand Down
14 changes: 8 additions & 6 deletions AmplifyTestCommon/Helpers/HubListenerTestUtilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Amplify
import Foundation

struct HubListenerTestUtilities {
enum HubListenerTestUtilities {

/// Blocks current thread until the listener with `token` is attached to the plugin. Returns `true` if the listener
/// becomes present before the `timeout` expires, `false` otherwise.
Expand All @@ -17,11 +17,13 @@ struct HubListenerTestUtilities {
/// - Parameter plugin: the plugin on which the listener will be checked
/// - Parameter timeout: the maximum length of time to wait for the listener to be registered
/// - Throws: if the plugin cannot be cast to `AWSHubPlugin`
static func waitForListener(with token: UnsubscribeToken,
plugin: HubCategoryPlugin? = nil,
timeout: TimeInterval,
file: StaticString = #file,
line: UInt = #line) async throws -> Bool {
static func waitForListener(
with token: UnsubscribeToken,
plugin: HubCategoryPlugin? = nil,
timeout: TimeInterval,
file: StaticString = #file,
line: UInt = #line
) async throws -> Bool {

let plugin = try plugin ?? Amplify.Hub.getPlugin(for: AWSHubPlugin.key)

Expand Down
2 changes: 1 addition & 1 deletion AmplifyTestCommon/Helpers/TypeRegistry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class TypeRegistry {
hasher.combine(ObjectIdentifier(type))
}

static func ==(lhs: TypeRegistry.Key, rhs: TypeRegistry.Key) -> Bool {
static func == (lhs: TypeRegistry.Key, rhs: TypeRegistry.Key) -> Bool {
lhs.type == rhs.type
}
}
Expand Down
Loading
Loading