Skip to content
Snippets Groups Projects
Commit b449334c authored by Daniel Ramteke's avatar Daniel Ramteke Committed by Nathan Harris
Browse files

[Commands] Add STRLEN

parent 8ff8b039
No related branches found
No related tags found
2 merge requests!164104 -- Use correct base method for zrevrange overload methods,!163STRLEN
Pipeline #492262259 canceled
Pipeline: RediStack

#492262268

    Pipeline: RediStack

    #492262266

      Pipeline: RediStack

      #492262265

        +3
        ......@@ -222,6 +222,12 @@ extension RedisCommand {
        ]
        return .init(keyword: "SETNX", arguments: args)
        }
        ///[STRLEN](https://redis.io/commands/strln)
        /// - Parameter key: The key to fetch the length of.
        public static func strln(_ key: RedisKey) -> RedisCommand<Int> {
        .init(keyword: "STRLEN", arguments: [.init(from: key)])
        }
        }
        // MARK: -
        ......
        ......@@ -229,4 +229,10 @@ final class StringCommandsTests: RediStackIntegrationTestCase {
        result = try connection.send(.decrby(#function, by: 0)).wait()
        XCTAssertEqual(result, 7)
        }
        func test_strlen() throws {
        XCTAssertNoThrow(try connection.set(#function, to: "value").wait())
        let val = try connection.send(.strln(#function)).wait()
        XCTAssertEqual(val, 5)
        }
        }
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Please register or to comment