Skip to content

Commit 10ab9e6

Browse files
committed
Unit Tests now use inline pass-throughs
References to `EventCentral.shared` are now replaced using the inline pass-through methods and members. We can now drop the `.shared` reference entirely everywhere.
1 parent ff72a1d commit 10ab9e6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Sources/EventDrivenSwift/Central/EventCentral.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ final public class EventCentral: EventDispatcher, EventCentralable {
2929
- Version: 1.0.0
3030
*/
3131
@inline(__always) public static var shared: EventDispatchable {
32-
get {
32+
@inline(__always) get {
3333
return _shared
3434
}
3535
}
3636

3737
@inline(__always) public static subscript() -> EventDispatchable {
38-
get {
38+
@inline(__always) get {
3939
return _shared
4040
}
4141
}

Tests/EventDrivenSwiftTests/BasicEventReceiverTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ final class BasicEventReceiverTests: XCTestCase {
5252
let eventThread = TestEventThread() // Create the Thread
5353

5454
XCTAssertEqual(eventThread.foo, 0, "Expect initial value of eventThread.foo to be 0, but it's \(eventThread.foo)")
55-
EventCentral.shared.queueEvent(testOne, priority: .normal) // Now let's dispatch our Event to change this value
55+
EventCentral.queueEvent(testOne, priority: .normal) // Now let's dispatch our Event to change this value
5656

5757
let result = eventThread.awaiter.wait(timeout: DispatchTime.now().advanced(by: DispatchTimeInterval.seconds(10)))
5858

@@ -94,7 +94,7 @@ final class BasicEventReceiverTests: XCTestCase {
9494

9595
XCTAssertEqual(eventThread.foo, 0, "Expect initial value of eventThread.foo to be 0, but it's \(eventThread.foo)")
9696

97-
EventCentral.shared.stackEvent(testOne, priority: .normal) // Now let's dispatch our Event to change this value
97+
EventCentral.stackEvent(testOne, priority: .normal) // Now let's dispatch our Event to change this value
9898

9999
let result = eventThread.awaiter.wait(timeout: DispatchTime.now().advanced(by: DispatchTimeInterval.seconds(10)))
100100

0 commit comments

Comments
 (0)