Skip to content

Commit db5f8e7

Browse files
committed
Formatting
1 parent ff1a95e commit db5f8e7

9 files changed

Lines changed: 294 additions & 393 deletions

File tree

Package.resolved

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/LoggingService/LoggingService.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616

1717
import Foundation
1818
#if canImport(Mini)
19-
import Mini
19+
import Mini
2020

21-
public class LoggingService: Service {
22-
public var id: UUID = UUID()
21+
public class LoggingService: Service {
22+
public var id: UUID = UUID()
2323

24-
public var perform: ServiceChain {
25-
return { action, _ -> Void in
26-
NSLog(String(dumping: action))
24+
public var perform: ServiceChain {
25+
return { action, _ -> Void in
26+
NSLog(String(dumping: action))
27+
}
2728
}
28-
}
2929

30-
public init() {}
31-
}
30+
public init() {}
31+
}
3232
#endif

Sources/Mini/Action.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import Foundation
2020
Protocol that has to be conformed by any object that can be dispatcher
2121
by a `Dispatcher` object.
2222
*/
23-
public protocol Action { }
23+
public protocol Action {}
2424

2525
extension Action {
2626
/// String used as tag of the given Action based on his name.

Sources/Mini/Promise.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public final class Promise<T>: PromiseType {
127127
return properties[member] as? Value
128128
}
129129

130-
public func dynamicallyCall<T>(withKeywordArguments args: KeyValuePairs<String, T>) -> Void {
130+
public func dynamicallyCall<T>(withKeywordArguments args: KeyValuePairs<String, T>) {
131131
guard let key = args.first?.key, let value = args.first?.value else { return }
132132
properties[key] = value
133133
}

Sources/TestMiddleware/TestMiddleware.swift

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,41 +16,41 @@
1616

1717
import Foundation
1818
#if canImport(Mini)
19-
import Mini
19+
import Mini
2020

21-
/// Action for testing purposes.
22-
public class TestOnlyAction: Action { }
21+
/// Action for testing purposes.
22+
public class TestOnlyAction: Action {}
2323

24-
/// Interceptor class for testing purposes which mute all the received actions.
25-
public class TestMiddleware: Middleware {
26-
public var id: UUID = UUID()
24+
/// Interceptor class for testing purposes which mute all the received actions.
25+
public class TestMiddleware: Middleware {
26+
public var id: UUID = UUID()
2727

28-
private var interceptedActions: [Action] = []
28+
private var interceptedActions: [Action] = []
2929

30-
public var perform: MiddlewareChain {
31-
return { action, _ -> Action in
32-
self.interceptedActions.append(action)
33-
return TestOnlyAction()
30+
public var perform: MiddlewareChain {
31+
return { action, _ -> Action in
32+
self.interceptedActions.append(action)
33+
return TestOnlyAction()
34+
}
3435
}
35-
}
3636

37-
public init() {}
37+
public init() {}
3838

3939
/// Check for actions of certain type being intercepted.
4040
///
4141
/// - Parameter kind: Action type to be checked against the intercepted actions.
42-
/// - Returns: Array of actions of `kind` being intercepted.
43-
public func actions<T: Action>(of _: T.Type) -> [T] {
44-
return interceptedActions.compactMap { $0 as? T }
45-
}
46-
47-
public func action<T: Action>(of _: T.Type, where params: (T) -> Bool) -> Bool {
48-
interceptedActions.compactMap { $0 as? T }.compactMap(params).first ?? false
49-
}
42+
/// - Returns: Array of actions of `kind` being intercepted.
43+
public func actions<T: Action>(of _: T.Type) -> [T] {
44+
return interceptedActions.compactMap { $0 as? T }
45+
}
5046

51-
/// Clear all the intercepted actions
52-
public func clear() {
53-
interceptedActions.removeAll()
47+
public func action<T: Action>(of _: T.Type, where params: (T) -> Bool) -> Bool {
48+
interceptedActions.compactMap { $0 as? T }.compactMap(params).first ?? false
49+
}
50+
51+
/// Clear all the intercepted actions
52+
public func clear() {
53+
interceptedActions.removeAll()
54+
}
5455
}
55-
}
5656
#endif

Tests/MiniSwiftTests/ActionTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import XCTest
44
final class ActionTests: XCTestCase {
55
func test_action_tag() {
66
let action = SetCounterAction(counter: 1)
7-
7+
88
XCTAssertEqual(String(describing: type(of: action)), SetCounterAction.tag)
99
}
1010
}

Tests/MiniSwiftTests/RxTests/PrimitiveSequenceTypeTests.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ final class PrimitiveSequenceTypeTests: XCTestCase {
3333
required init(promise: Promise<Payload>) {
3434
counter = promise
3535
}
36-
36+
3737
static func == (lhs: TestCompletableAction, rhs: TestCompletableAction) -> Bool {
3838
lhs.counter == rhs.counter
3939
}
@@ -48,7 +48,7 @@ final class PrimitiveSequenceTypeTests: XCTestCase {
4848
required init(promise: [Key: Promise<Payload>]) {
4949
counterMap = promise
5050
}
51-
51+
5252
static func == (lhs: TestKeyedCompletableAction, rhs: TestKeyedCompletableAction) -> Bool {
5353
lhs.counterMap == rhs.counterMap
5454
}
@@ -60,8 +60,8 @@ final class PrimitiveSequenceTypeTests: XCTestCase {
6060
required init(promise: Promise<Void>) {
6161
self.promise = promise
6262
}
63-
64-
static func == (lhs: TestEmptyAction, rhs: TestEmptyAction) -> Bool {
63+
64+
static func == (_: TestEmptyAction, _: TestEmptyAction) -> Bool {
6565
true
6666
}
6767
}
@@ -101,8 +101,8 @@ final class PrimitiveSequenceTypeTests: XCTestCase {
101101
).toEventually(be(1))
102102

103103
expect(self.testMiddleware.action(of: TestCompletableAction.self) {
104-
$0.counter == .error(Error.dummy)
105-
}
104+
$0.counter == .error(Error.dummy)
105+
}
106106
).toEventually(beTrue())
107107
}
108108

@@ -129,8 +129,8 @@ final class PrimitiveSequenceTypeTests: XCTestCase {
129129
expect(
130130
self.testMiddleware
131131
.action(of: TestKeyedCompletableAction.self) {
132-
$0.counterMap == ["hello": .error(Error.dummy)]
133-
}
132+
$0.counterMap == ["hello": .error(Error.dummy)]
133+
}
134134
).toEventually(beTrue())
135135
}
136136

Tests/MiniSwiftTests/XCTestManifests.swift

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
#if !canImport(ObjectiveC)
22
import XCTest
33

4+
extension ActionTests {
5+
// DO NOT MODIFY: This is autogenerated, use:
6+
// `swift test --generate-linuxmain`
7+
// to regenerate.
8+
static let __allTests__ActionTests = [
9+
("test_action_tag", test_action_tag),
10+
]
11+
}
12+
413
extension ChainTests {
5-
// DO NOT MODIFY: This is autogenerated, use:
6-
// `swift test --generate-linuxmain`
14+
// DO NOT MODIFY: This is autogenerated, use:
15+
// `swift test --generate-linuxmain`
716
// to regenerate.
817
static let __allTests__ChainTests = [
918
("test_forwarding_chain_forwards_action", test_forwarding_chain_forwards_action),
1019
]
1120
}
1221

1322
extension DictionaryExtensionsTests {
14-
// DO NOT MODIFY: This is autogenerated, use:
15-
// `swift test --generate-linuxmain`
23+
// DO NOT MODIFY: This is autogenerated, use:
24+
// `swift test --generate-linuxmain`
1625
// to regenerate.
1726
static let __allTests__DictionaryExtensionsTests = [
1827
("test_get_or_put", test_get_or_put),
@@ -21,17 +30,17 @@
2130
}
2231

2332
extension DispatchQueueTests {
24-
// DO NOT MODIFY: This is autogenerated, use:
25-
// `swift test --generate-linuxmain`
33+
// DO NOT MODIFY: This is autogenerated, use:
34+
// `swift test --generate-linuxmain`
2635
// to regenerate.
2736
static let __allTests__DispatchQueueTests = [
2837
("test_main_queue", test_main_queue),
2938
]
3039
}
3140

3241
extension DispatcherTests {
33-
// DO NOT MODIFY: This is autogenerated, use:
34-
// `swift test --generate-linuxmain`
42+
// DO NOT MODIFY: This is autogenerated, use:
43+
// `swift test --generate-linuxmain`
3544
// to regenerate.
3645
static let __allTests__DispatcherTests = [
3746
("test_add_remove_middleware", test_add_remove_middleware),
@@ -41,8 +50,8 @@
4150
}
4251

4352
extension ObservableTypeTests {
44-
// DO NOT MODIFY: This is autogenerated, use:
45-
// `swift test --generate-linuxmain`
53+
// DO NOT MODIFY: This is autogenerated, use:
54+
// `swift test --generate-linuxmain`
4655
// to regenerate.
4756
static let __allTests__ObservableTypeTests = [
4857
("test_dispatch_action_from_store", test_dispatch_action_from_store),
@@ -52,8 +61,8 @@
5261
}
5362

5463
extension PrimitiveSequenceTypeTests {
55-
// DO NOT MODIFY: This is autogenerated, use:
56-
// `swift test --generate-linuxmain`
64+
// DO NOT MODIFY: This is autogenerated, use:
65+
// `swift test --generate-linuxmain`
5766
// to regenerate.
5867
static let __allTests__PrimitiveSequenceTypeTests = [
5968
("test_completable_action_action", test_completable_action_action),
@@ -67,10 +76,11 @@
6776
}
6877

6978
extension PromiseTests {
70-
// DO NOT MODIFY: This is autogenerated, use:
71-
// `swift test --generate-linuxmain`
79+
// DO NOT MODIFY: This is autogenerated, use:
80+
// `swift test --generate-linuxmain`
7281
// to regenerate.
7382
static let __allTests__PromiseTests = [
83+
("test_dynamic_extension", test_dynamic_extension),
7484
("test_empty_resolution", test_empty_resolution),
7585
("test_equality_completed", test_equality_completed),
7686
("test_equality_error", test_equality_error),
@@ -88,8 +98,8 @@
8898
}
8999

90100
extension ReducerTests {
91-
// DO NOT MODIFY: This is autogenerated, use:
92-
// `swift test --generate-linuxmain`
101+
// DO NOT MODIFY: This is autogenerated, use:
102+
// `swift test --generate-linuxmain`
93103
// to regenerate.
94104
static let __allTests__ReducerTests = [
95105
("test_dispatcher_triggers_action_in_reducer_group_reducer", test_dispatcher_triggers_action_in_reducer_group_reducer),
@@ -103,6 +113,7 @@
103113

104114
public func __allTests() -> [XCTestCaseEntry] {
105115
return [
116+
testCase(ActionTests.__allTests__ActionTests),
106117
testCase(ChainTests.__allTests__ChainTests),
107118
testCase(DictionaryExtensionsTests.__allTests__DictionaryExtensionsTests),
108119
testCase(DispatchQueueTests.__allTests__DispatchQueueTests),

0 commit comments

Comments
 (0)