Skip to content

Commit

Permalink
Merge pull request #59 from cmushroom/dev
Browse files Browse the repository at this point in the history
2.5.1
  • Loading branch information
chengpan168 committed Dec 4, 2022
2 parents 51be662 + 35acddf commit af4d9f2
Show file tree
Hide file tree
Showing 34 changed files with 420 additions and 684 deletions.
Binary file modified .DS_Store
Binary file not shown.
6 changes: 3 additions & 3 deletions .version
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"latestVersionNum": 19,
"latestVersion": "2.5.0",
"latestVersionNum": 20,
"latestVersion": "2.5.1",
"updateType": "hint",
"releaseNotes": "1. 解决失焦后重新获取焦点tab切换问题,同时解决了最小化到dock唤起的问题 #55 #38。 \n2. 增加用户名登录。"
"releaseNotes": "1. 修复低版本用户名问题。"
}
26 changes: 26 additions & 0 deletions Tests/RedisBaseTests/RedisBaseTest.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// RedisClientBaseTest.swift
// Tests
//
// Created by chengpan on 2022/12/3.
//

import XCTest

open class RedisBaseTest: XCTestCase {
open var redisHostname: String {
return ProcessInfo.processInfo.environment["REDIS_HOST"] ?? "localhost"
}

open var redisPort: Int {
return Int(ProcessInfo.processInfo.environment["REDIS_PORT"] ?? "6379")!
}

open var redisUsername: String? {
return ProcessInfo.processInfo.environment["REDIS_USERNAME"]
}

open var redisPassword: String? {
return ProcessInfo.processInfo.environment["REDIS_PW"]
}
}
36 changes: 36 additions & 0 deletions Tests/RedisBaseTests/RedisClientBaseTest.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// RedisClientBaseTests.swift
// Tests
//
// Created by chengpan on 2022/12/3.
//

@testable import redis_pro
import XCTest
import Foundation
import Logging

open class RedisClientBaseTest: RedisBaseTest {
let logger = Logger(label: "redis-client-test")

var redisClient: RediStackClient!

open override func setUp() {
logger.info("redis client base test setUp...")
redisClient = .init(RedisModel(host: redisHostname, port: redisPort, username: redisUsername, password: redisPassword))
// let conn = try await redisClient.initConn(host: redisHostname, port: redisPort, username: redisUsername ?? "", pass: redisPassword ?? "", database: 0)
}

/// Sends a "FLUSHALL" command to Redis to clear it of any data from the previous test, then closes the connection.
///
/// If any steps fail, a `fatalError` is thrown.
///
/// See `XCTest.XCTestCase.tearDown()`
open override func tearDown() {
// Task {
// await redisClient.flushDB()
// }

redisClient.close()
}
}
27 changes: 27 additions & 0 deletions Tests/RedisCommandTests/RedisClentStringTest.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// RedisClent.swift
// Tests
//
// Created by chengpan on 2022/12/3.
//

@testable import redis_pro
import XCTest
import Foundation

class RedisClentStringTest: RedisClientBaseTest {
let key = "redis_client_test_key"
let value = "redis_client_test_value"

func testSetKey() async {
await redisClient.set(key, value: value)
}

func testGetKey() async {
await testSetKey()
let r = await redisClient.get(key)

logger.info("redis client test get key, r: \(r)")
XCTAssertEqual(value, r)
}
}
19 changes: 4 additions & 15 deletions redis-proTests/redis_proTests.swift → Tests/Tests.swift
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
//
// redis_proTests.swift
// redis-proTests
// Tests.swift
// Tests
//
// Created by chenpanwang on 2022/1/6.
// Created by chengpan on 2022/12/3.
//

import XCTest
import RediStack
@testable import redis_pro

class redis_proTests: XCTestCase {
final class Tests: XCTestCase {

override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
Expand All @@ -20,15 +18,6 @@ class redis_proTests: XCTestCase {
}

func testExample() throws {

// defer {
// instance.getClient().close()
// }
//


//

// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
// Any test you write for XCTest can be annotated as throws and async.
Expand Down
274 changes: 146 additions & 128 deletions redis-pro.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
{
"identity" : "appcenter-sdk-apple",
"kind" : "remoteSourceControl",
"location" : "https://gitee.com/chengpan168_admin/appcenter-sdk-apple.git",
"location" : "https://github.com/microsoft/appcenter-sdk-apple.git",
"state" : {
"revision" : "25f64229373de97ff3920941cd52203193e5d8be",
"version" : "4.3.0"
"revision" : "88e65475ffd3a7cf2bbde07df9e62159a1fd60a8",
"version" : "5.0.0"
}
},
{
Expand All @@ -23,26 +23,26 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/microsoft/PLCrashReporter.git",
"state" : {
"revision" : "6b27393cad517c067dceea85fadf050e70c4ceaa",
"version" : "1.10.1"
"revision" : "b1a342da19ed9b3af61ea2efa7656c2af30aeb7c",
"version" : "1.11.0"
}
},
{
"identity" : "puppy",
"kind" : "remoteSourceControl",
"location" : "https://github.com/sushichop/Puppy.git",
"state" : {
"revision" : "7cfae42becac2d8916cb1a866dd12d9843199df9",
"version" : "0.5.0"
"revision" : "9f3cf02dc92bc233e40ba8a66af20abb97978929",
"version" : "0.6.0"
}
},
{
"identity" : "redistack",
"kind" : "remoteSourceControl",
"location" : "https://github.com/chengpan168/RediStack",
"state" : {
"branch" : "feat/username",
"revision" : "fd298674d753396482e029d0628a7c82316ea199"
"branch" : "feat/user",
"revision" : "07a005e97530334efec8ed4b5c96a91e2b45c3f5"
}
},
{
Expand Down Expand Up @@ -113,8 +113,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-log.git",
"state" : {
"revision" : "5d66f7ba25daf4f94100e7022febf3c75e37a6c7",
"version" : "1.4.2"
"revision" : "6fe203dc33195667ce1759bf0182975e4653ba1c",
"version" : "1.4.4"
}
},
{
Expand Down
Binary file not shown.
15 changes: 8 additions & 7 deletions redis-pro.xcodeproj/xcshareddata/xcschemes/redis-pro.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,20 @@
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CE0290D2278707280058442B"
BuildableName = "redis-proTests.xctest"
BlueprintName = "redis-proTests"
BlueprintIdentifier = "4301C85826BBEB5000C08E19"
BuildableName = "redisProUnitTests.xctest"
BlueprintName = "redisProUnitTests"
ReferencedContainer = "container:redis-pro.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4301C85826BBEB5000C08E19"
BuildableName = "redisProUnitTests.xctest"
BlueprintName = "redisProUnitTests"
BlueprintIdentifier = "62BDAB2A293B040C00ADA406"
BuildableName = "Tests.xctest"
BlueprintName = "Tests"
ReferencedContainer = "container:redis-pro.xcodeproj">
</BuildableReference>
</TestableReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,5 @@
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "D30A974A-E026-4F0F-9798-3DCF3A9D1159"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "redis-pro/Common/RedisClient/RediStackClient.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "232"
endingLineNumber = "232"
landmarkName = "initConn(host:port:username:pass:database:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
Original file line number Diff line number Diff line change
Expand Up @@ -9,56 +9,77 @@
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>6</integer>
<integer>10</integer>
</dict>
<key>CustomDump (Playground) 2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>7</integer>
<integer>13</integer>
</dict>
<key>CustomDump (Playground) 3.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>25</integer>
<integer>11</integer>
</dict>
<key>CustomDump (Playground) 4.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>26</integer>
<integer>12</integer>
</dict>
<key>CustomDump (Playground) 5.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>27</integer>
<integer>14</integer>
</dict>
<key>CustomDump (Playground) 6.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>28</integer>
</dict>
<key>CustomDump (Playground) 7.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>29</integer>
</dict>
<key>CustomDump (Playground) 8.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>30</integer>
</dict>
<key>CustomDump (Playground).xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>5</integer>
<integer>8</integer>
</dict>
<key>Playground (Playground) 1.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>9</integer>
<integer>20</integer>
</dict>
<key>Playground (Playground) 2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>10</integer>
<integer>22</integer>
</dict>
<key>Playground (Playground) 3.xcscheme</key>
<dict>
Expand Down Expand Up @@ -86,7 +107,7 @@
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>8</integer>
<integer>17</integer>
</dict>
<key>PromiseKit (Playground) 1.xcscheme</key>
<dict>
Expand Down
22 changes: 22 additions & 0 deletions redis-pro/Command/AbountCommand.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// AbountCommand.swift
// redis-pro
//
// Created by chengpan on 2022/12/3.
//

import Foundation
import SwiftUI

struct AboutCommands: View {

@Environment(\.openURL) var openURL
var body: some View {
Button("About") {
guard let url = URL(string: "redis-pro:https://AboutView") else {
return
}
openURL(url)
}
}
}
17 changes: 17 additions & 0 deletions redis-pro/Command/CheckUpdateCommand.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// CheckUpdateCommand.swift
// redis-pro
//
// Created by chengpan on 2022/12/3.
//

import SwiftUI
import Foundation

struct CheckUpdateCommands: View {
var body: some View {
Button("Check Update") {
VersionManager().checkUpdate(isNoUpgradeHint: true)
}
}
}
Loading

0 comments on commit af4d9f2

Please sign in to comment.