Skip to content

Commit 284b7f0

Browse files
committed
Add overload of ping command for nil message style
1 parent 9da5773 commit 284b7f0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Sources/RediStack/Commands/ConnectionCommands.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ extension RedisCommand {
4141
}
4242
}
4343

44+
/// [PING](https://redis.io/commands/ping)
45+
public static var ping: RedisCommand<String> { Self.ping(with: nil) }
46+
4447
/// [AUTH](https://redis.io/commands/auth)
4548
/// - Parameter password: The password to authenticate with.
4649
public static func auth(with password: String) -> RedisCommand<Void> {

Tests/RediStackIntegrationTests/Commands/ConnectionCommandsTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ final class ConnectionCommandsTests: RediStackIntegrationTestCase {
2323

2424
let second = try connection.ping(with: "My message").wait()
2525
XCTAssertEqual(second, "My message")
26+
27+
let third = try connection.send(.ping).wait()
28+
XCTAssertEqual(third, first)
2629
}
2730

2831
func test_echo() throws {

0 commit comments

Comments
 (0)