Skip to content

Commit

Permalink
Reusing existing unit tests for old & new implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
jguz-pubnub committed Oct 31, 2023
1 parent a350a1c commit 9b7c1f5
Show file tree
Hide file tree
Showing 6 changed files with 416 additions and 184 deletions.
8 changes: 4 additions & 4 deletions PubNub.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@
3D2D57252A8A1EEC00BEA8CB /* WaitEffect.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D2D57242A8A1EEC00BEA8CB /* WaitEffect.swift */; };
3D371DE62A4EE20700953D7F /* PubNubEventEngineTestsHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D371DE52A4EE20700953D7F /* PubNubEventEngineTestsHelpers.swift */; };
3D371DE72A4EE20700953D7F /* PubNubEventEngineTestsHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D371DE52A4EE20700953D7F /* PubNubEventEngineTestsHelpers.swift */; };
3D5848A02AEBED5C00C20C92 /* SubscribeRouterWithEventEngineTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D58489F2AEBED5C00C20C92 /* SubscribeRouterWithEventEngineTests.swift */; };
3D62D6EB2AF1404900EA46F9 /* SubscriptionSessionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D62D6EA2AF1404900EA46F9 /* SubscriptionSessionTests.swift */; };
3D8773662A6130EC004A2953 /* Presence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8773652A6130EC004A2953 /* Presence.swift */; };
3D8773682A613A58004A2953 /* PresenceTransition.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8773672A613A58004A2953 /* PresenceTransition.swift */; };
3D9134972A1216F7000A5124 /* PubNubPushTargetTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9134962A1216F7000A5124 /* PubNubPushTargetTests.swift */; };
Expand Down Expand Up @@ -954,7 +954,7 @@
3D2D57222A8A1AF100BEA8CB /* PresenceLeaveRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PresenceLeaveRequest.swift; sourceTree = "<group>"; };
3D2D57242A8A1EEC00BEA8CB /* WaitEffect.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WaitEffect.swift; sourceTree = "<group>"; };
3D371DE52A4EE20700953D7F /* PubNubEventEngineTestsHelpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PubNubEventEngineTestsHelpers.swift; sourceTree = "<group>"; };
3D58489F2AEBED5C00C20C92 /* SubscribeRouterWithEventEngineTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscribeRouterWithEventEngineTests.swift; sourceTree = "<group>"; };
3D62D6EA2AF1404900EA46F9 /* SubscriptionSessionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionSessionTests.swift; sourceTree = "<group>"; };
3D8773652A6130EC004A2953 /* Presence.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Presence.swift; sourceTree = "<group>"; };
3D8773672A613A58004A2953 /* PresenceTransition.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PresenceTransition.swift; sourceTree = "<group>"; };
3D9134962A1216F7000A5124 /* PubNubPushTargetTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PubNubPushTargetTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1217,6 +1217,7 @@
isa = PBXGroup;
children = (
35458BA2230CB3570085B502 /* SubscribeSessionFactoryTests.swift */,
3D62D6EA2AF1404900EA46F9 /* SubscriptionSessionTests.swift */,
);
path = Subscription;
sourceTree = "<group>";
Expand Down Expand Up @@ -1627,7 +1628,6 @@
35A6C7B622FBEA7200E97CC5 /* PushRouterTests.swift */,
359287B3231720C20046F7A2 /* PublishRouterTests.swift */,
359287BC23173D490046F7A2 /* SubscribeRouterTests.swift */,
3D58489F2AEBED5C00C20C92 /* SubscribeRouterWithEventEngineTests.swift */,
3557CDFF237F6380004BBACC /* TimeRouterTests.swift */,
35DA9AB42335491F00867989 /* ObjectsUUIDRouterTests.swift */,
3562DBC22345066F006DFFBC /* ObjectsChannelRouterTests.swift */,
Expand Down Expand Up @@ -3421,7 +3421,6 @@
35FE941B22EFE5400051C455 /* EventStreamTests.swift in Sources */,
35FE93C322EF57FA0051C455 /* Session+URLErrorTests.swift in Sources */,
35FE940122EF983A0051C455 /* Session+EndpointErrorTests.swift in Sources */,
3D5848A02AEBED5C00C20C92 /* SubscribeRouterWithEventEngineTests.swift in Sources */,
3D9B29FA2A65609000C988C9 /* EmitMessagesTests.swift in Sources */,
357AEB8422E6954600C18250 /* Collection+PubNubTests.swift in Sources */,
35D0615223035E4300FDB2F9 /* CryptoTests.swift in Sources */,
Expand All @@ -3433,6 +3432,7 @@
35CDFEBC22E789B200F3B9F2 /* ConstantsTests.swift in Sources */,
35CF54A0248D96320099FE81 /* SubscribeRouterTests.swift in Sources */,
35CF54A1248DA6430099FE81 /* ObjectsChannelRouterTests.swift in Sources */,
3D62D6EB2AF1404900EA46F9 /* SubscriptionSessionTests.swift in Sources */,
3DB56B652A715F7E00FC35A0 /* HeartbeatEffectTests.swift in Sources */,
359C2C1422EBB56A009C3B4B /* Int+PubNubTests.swift in Sources */,
35CDFEC022E7B48000F3B9F2 /* ImportTestResource.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class EventEngineSubscriptionSessionStrategy: SubscriptionSessionStrategy {

private func listenForStateUpdates() {
subscribeEngine.onStateUpdated = { [weak self] state in
if state.hasTimetoken {
if state is Subscribe.ReceivingState && state.hasTimetoken {
self?.previousTokenResponse = state.cursor
}
}
Expand Down
4 changes: 0 additions & 4 deletions Sources/PubNub/Subscription/SubscriptionSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ public class SubscriptionSession {
strategy.uuid
}

/// PSV2 feature to subscribe with a custom filter expression.
@available(*, unavailable)
public var filterExpression: String?

private let strategy: any SubscriptionSessionStrategy

var previousTokenResponse: SubscribeCursor? {
Expand Down
Loading

0 comments on commit 9b7c1f5

Please sign in to comment.