Skip to content

Commit e08b426

Browse files
PeterAdams-AMordil
authored andcommitted
Get pubsub numpat working
1 parent 410a5b2 commit e08b426

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Sources/RediStack/Commands/PubSubCommands.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ extension RedisCommand {
4646

4747
/// [PUBSUB NUMPAT](https://redis.io/commands/pubsub#codepubsub-numpatcode)
4848
public static func pubsubNumpat() -> RedisCommand<Int> {
49-
return .init(keyword: "PUBSUB NUMPAT", arguments: [])
49+
return .init(keyword: "PUBSUB", arguments: [.init(bulk: "NUMPAT")])
5050
}
5151

5252
/// [PUBSUB NUMSUB](https://redis.io/commands/pubsub#codepubsub-numsub-channel-1--channel-ncode)

Tests/RediStackIntegrationTests/Commands/PubSubCommandsTests.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,14 @@ final class RedisPubSubCommandsTests: RediStackIntegrationTestCase {
190190
self.waitForExpectations(timeout: 1)
191191
}
192192

193+
func test_pubSubNumpat() throws {
194+
let queryConnection = try self.makeNewConnection()
195+
defer { try? queryConnection.close().wait() }
196+
197+
let numPat = try queryConnection.send(.pubsubNumpat()).wait()
198+
XCTAssertGreaterThanOrEqual(numPat, 0)
199+
}
200+
193201
func test_pubSubChannels() throws {
194202
let fn = #function
195203
let subscriber = try self.makeNewConnection()

0 commit comments

Comments
 (0)