Commit 79757dc0 authored by Nathan Harris's avatar Nathan Harris

Merge branch 'swifty-append' into 'master'

Swap `append(_🇹🇴)` parameters in signature

See merge request Mordil/swift-redis-nio-client!62
parents 0facb906 8c676812
Pipeline #67992505 passed with stages
in 5 minutes and 16 seconds
......@@ -89,16 +89,16 @@ extension RedisClient {
.map { return $0 == 1 }
/// Append a value to the end of an existing entry
/// - Note: If the key does not exist it is created and set as an empty string, so APPEND will be similar to SET in this special case.
/// Append a value to the end of an existing entry.
/// - Note: If the key does not exist, it is created and set as an empty string, so `APPEND` will be similar to `SET` in this special case.
/// [](
/// See [](
/// - Parameters:
/// - value: The value to append onto the value stored at the key.
/// - key: The key to use to uniquely identify this value.
/// - value: The value to append the key to.
/// - Returns: Integer with the new length of the value
/// - Returns: The length of the key's value after appending the additional value.
public func append(_ key: String, to value: RESPValueConvertible) -> EventLoopFuture<Int> {
public func append(_ value: RESPValueConvertible, to key: String) -> EventLoopFuture<Int> {
return send(command: "APPEND", with: [key, value])
......@@ -61,8 +61,8 @@ final class StringCommandsTests: XCTestCase {
func test_append() throws {
let result = "value appended"
XCTAssertNoThrow(try connection.append(#function, to: "value").wait())
let length = try connection.append(#function, to: " appended").wait()
XCTAssertNoThrow(try connection.append("value", to: #function).wait())
let length = try connection.append(" appended", to: #function).wait()
XCTAssertEqual(length, result.count)
let val = try connection.get(#function).wait()
XCTAssertEqual(val, result)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment