diff --git a/Sources/RediStack/Commands/PubSubCommands.swift b/Sources/RediStack/Commands/PubSubCommands.swift index 0e1f4f9..d78bac4 100644 --- a/Sources/RediStack/Commands/PubSubCommands.swift +++ b/Sources/RediStack/Commands/PubSubCommands.swift @@ -46,7 +46,7 @@ extension RedisCommand { /// [PUBSUB NUMPAT](https://redis.io/commands/pubsub#codepubsub-numpatcode) public static func pubsubNumpat() -> RedisCommand { - return .init(keyword: "PUBSUB NUMPAT", arguments: []) + return .init(keyword: "PUBSUB", arguments: [.init(bulk: "NUMPAT")]) } /// [PUBSUB NUMSUB](https://redis.io/commands/pubsub#codepubsub-numsub-channel-1--channel-ncode) diff --git a/Tests/RediStackIntegrationTests/Commands/PubSubCommandsTests.swift b/Tests/RediStackIntegrationTests/Commands/PubSubCommandsTests.swift index 5e55fb8..c6d0e6d 100644 --- a/Tests/RediStackIntegrationTests/Commands/PubSubCommandsTests.swift +++ b/Tests/RediStackIntegrationTests/Commands/PubSubCommandsTests.swift @@ -190,6 +190,14 @@ final class RedisPubSubCommandsTests: RediStackIntegrationTestCase { self.waitForExpectations(timeout: 1) } + func test_pubSubNumpat() throws { + let queryConnection = try self.makeNewConnection() + defer { try? queryConnection.close().wait() } + + let numPat = try queryConnection.send(.pubsubNumpat()).wait() + XCTAssertGreaterThanOrEqual(numPat, 0) + } + func test_pubSubChannels() throws { let fn = #function let subscriber = try self.makeNewConnection()