Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Sources/PerfectRedis/RedisClientSync.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@ public extension RedisClient {
return ret
}

public func sendCommand(name: String, parameters: [RedisResponse]) throws -> RedisResponse {
func sendCommand(name: String, parameters: [RedisResponse]) throws -> RedisResponse {
let a = commandBytes(name: name, parameters: parameters)
return try sendRawCommand(bytes: a)
}

public func sendCommand(name: String) throws -> RedisResponse {
func sendCommand(name: String) throws -> RedisResponse {
let a = commandBytes(name: name)
return try sendRawCommand(bytes: a)
}

// Send command as serialized in RESP format: See https://redis.io/topics/protocol
public func sendCommandAsRESP(name: String, parameters: [String]) throws -> RedisResponse {
func sendCommandAsRESP(name: String, parameters: [String]) throws -> RedisResponse {
var array = [RedisResponse.bulkString(name.bytes)]
#if swift(>=4.1)
array.append(contentsOf: parameters.compactMap({ RedisResponse.bulkString($0.bytes) }))
Expand Down
4 changes: 2 additions & 2 deletions Tests/PerfectRedisTests/HashTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class HashTests: XCTestCase {
let client = try c()
client.hashSet(key: key, field: field, value: .string(value)) {
response in
guard case .integer(let result) = response else {
guard case .integer(_) = response else {
XCTFail("Unexpected response \(response)")
expectation.fulfill()
return
Expand Down Expand Up @@ -313,7 +313,7 @@ class HashTests: XCTestCase {
let client = try c()
client.hashSet(key: key, field: field, value: .string(value)) {
response in
guard case .integer(let result) = response else {
guard case .integer(_) = response else {
XCTFail("Unexpected response \(response)")
expectation.fulfill()
return
Expand Down
8 changes: 3 additions & 5 deletions Tests/PerfectRedisTests/PerfectRedisTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ class PerfectRedisTests: XCTestCase {

do {
let client = try c()
defer {
RedisClient.releaseClient(client)
expectation.fulfill()
}
RedisClient.releaseClient(client)
expectation.fulfill()
} catch {
XCTAssert(false, "Could not connect to server \(error)")
expectation.fulfill()
Expand Down Expand Up @@ -334,7 +332,7 @@ class PerfectRedisTests: XCTestCase {
let client = try c()
client.set(key: key, value: .string(value)) {
response in
guard case .simpleString(let s) = response else {
guard case .simpleString(_) = response else {
XCTAssert(false, "Unexpected response \(response)")
expectation.fulfill()
return
Expand Down
10 changes: 10 additions & 0 deletions Tests/PerfectRedisTests/XCTestManifests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import XCTest

#if !canImport(ObjectiveC)
public func allTests() -> [XCTestCaseEntry] {
return [
testCase(PerfectRedisTests.allTests),
testCase(HashTests.allTests),
]
}
#endif