Add a CONTRIBUTING.md, fix indent
... beautz is in the eye of the beholder.
This commit is contained in:
parent
1a55bd2031
commit
c3720e219d
|
@ -0,0 +1,5 @@
|
|||
By submitting a pull request, you represent that you have the right to license
|
||||
your contribution to the community, and agree by submitting the patch
|
||||
that your contributions are licensed under the Apache 2.0 license (see
|
||||
`LICENSE.txt`).
|
||||
|
|
@ -2,11 +2,12 @@ import XCTest
|
|||
@testable import NIORedis
|
||||
|
||||
final class RESPValueTests: XCTestCase {
|
||||
func testDescription() throws {
|
||||
XCTAssert(String(describing: RESPValue(1)) == "1")
|
||||
}
|
||||
|
||||
func testDescription() throws {
|
||||
XCTAssert(String(describing: RESPValue(1)) == "1")
|
||||
}
|
||||
|
||||
static var allTests = [
|
||||
("testDescription", testDescription)
|
||||
]
|
||||
static var allTests = [
|
||||
("testDescription", testDescription)
|
||||
]
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@ import XCTest
|
|||
|
||||
#if !os(macOS)
|
||||
public func allTests() -> [XCTestCaseEntry] {
|
||||
return [
|
||||
testCase(RESPValueTests.allTests),
|
||||
]
|
||||
return [
|
||||
testCase(RESPValueTests.allTests),
|
||||
]
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,32 +1,37 @@
|
|||
import XCTest
|
||||
@testable import Redis
|
||||
import NIO
|
||||
@testable import Redis
|
||||
|
||||
final class RedisClientTests: XCTestCase {
|
||||
func testCreateClientWithDefaultArguments() throws {
|
||||
let redisClient = Redis.createClient()
|
||||
|
||||
func testCreateClientWithDefaultArguments() throws {
|
||||
let redisClient = Redis.createClient()
|
||||
|
||||
XCTAssert(redisClient.options.hostname! == "127.0.0.1")
|
||||
XCTAssert(redisClient.options.port == 6379)
|
||||
XCTAssert(redisClient.options.password == nil)
|
||||
XCTAssert(redisClient.options.database == nil)
|
||||
}
|
||||
XCTAssert(redisClient.options.hostname! == "127.0.0.1")
|
||||
XCTAssert(redisClient.options.port == 6379)
|
||||
XCTAssert(redisClient.options.password == nil)
|
||||
XCTAssert(redisClient.options.database == nil)
|
||||
}
|
||||
|
||||
func testCreateClientWithSpecifiedArguments() throws {
|
||||
let eventLoop = MultiThreadedEventLoopGroup(numberOfThreads: 1).next()
|
||||
func testCreateClientWithSpecifiedArguments() throws {
|
||||
let eventLoop = MultiThreadedEventLoopGroup(numberOfThreads: 1).next()
|
||||
|
||||
let redisClient = Redis.createClient(port: 6380, host: "localhost", password: "password", db: 1, eventLoopGroup: eventLoop)
|
||||
let redisClient = Redis.createClient(port: 6380, host: "localhost",
|
||||
password: "password", db: 1,
|
||||
eventLoopGroup: eventLoop)
|
||||
|
||||
XCTAssert(redisClient.options.hostname! == "localhost")
|
||||
XCTAssert(redisClient.options.port == 6380)
|
||||
XCTAssert(redisClient.options.password == "password")
|
||||
XCTAssert(redisClient.options.database == 1)
|
||||
XCTAssert(redisClient.options.eventLoopGroup === eventLoop)
|
||||
XCTAssert(redisClient.eventLoop === eventLoop)
|
||||
}
|
||||
XCTAssert(redisClient.options.hostname! == "localhost")
|
||||
XCTAssert(redisClient.options.port == 6380)
|
||||
XCTAssert(redisClient.options.password == "password")
|
||||
XCTAssert(redisClient.options.database == 1)
|
||||
XCTAssert(redisClient.options.eventLoopGroup === eventLoop)
|
||||
XCTAssert(redisClient.eventLoop === eventLoop)
|
||||
}
|
||||
|
||||
static var allTests = [
|
||||
("testCreateClientWithDefaultArguments", testCreateClientWithDefaultArguments),
|
||||
("testCreateClientWithSpecifiedArguments", testCreateClientWithSpecifiedArguments),
|
||||
]
|
||||
static var allTests = [
|
||||
( "testCreateClientWithDefaultArguments",
|
||||
testCreateClientWithDefaultArguments. ),
|
||||
( "testCreateClientWithSpecifiedArguments",
|
||||
testCreateClientWithSpecifiedArguments ),
|
||||
]
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@ import XCTest
|
|||
|
||||
#if !os(macOS)
|
||||
public func allTests() -> [XCTestCaseEntry] {
|
||||
return [
|
||||
testCase(RedisClientTests.allTests),
|
||||
]
|
||||
return [
|
||||
testCase(RedisClientTests.allTests),
|
||||
]
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue