Skip to content

Commit

Permalink
fix test w/ indeterminate array ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner0101 committed May 18, 2017
1 parent cc70bb2 commit 70917ee
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Tests/RedisTests/LiveTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ class LiveTests: XCTestCase {

let res = try client.command(.keys, ["*"])

XCTAssertEqual(res!.array!.flatMap { $0?.string }, ["FOO", "BAR"])
if let strings = res?.array?.flatMap({ $0?.string }) {
XCTAssertEqual(strings.count, 2)
XCTAssert(strings.contains("FOO"))
XCTAssert(strings.contains("BAR"))
} else {
XCTFail("Invalid response")
}
}

func testString() throws {
Expand Down

0 comments on commit 70917ee

Please sign in to comment.