aboutsummaryrefslogtreecommitdiffhomepage
path: root/Example/Messaging/Tests/FIRMessagingPubSubTest.m
diff options
context:
space:
mode:
Diffstat (limited to 'Example/Messaging/Tests/FIRMessagingPubSubTest.m')
-rw-r--r--Example/Messaging/Tests/FIRMessagingPubSubTest.m9
1 files changed, 9 insertions, 0 deletions
diff --git a/Example/Messaging/Tests/FIRMessagingPubSubTest.m b/Example/Messaging/Tests/FIRMessagingPubSubTest.m
index 3af1402..e1260f5 100644
--- a/Example/Messaging/Tests/FIRMessagingPubSubTest.m
+++ b/Example/Messaging/Tests/FIRMessagingPubSubTest.m
@@ -78,4 +78,13 @@ static NSString *const kTopicName = @"topic-Name";
XCTAssertTrue([FIRMessagingPubSub isValidTopicWithPrefix:topic]);
}
+- (void)testRemoveTopicPrefix {
+ NSString *topic = [NSString stringWithFormat:@"/topics/%@", kTopicName];
+ topic = [FIRMessagingPubSub removePrefixFromTopic:topic];
+ XCTAssertEqualObjects(topic, kTopicName);
+ // if the topic doesn't have the prefix, should return topic itself.
+ topic = [FIRMessagingPubSub removePrefixFromTopic:kTopicName];
+ XCTAssertEqualObjects(topic, kTopicName);
+}
+
@end