Skip to content

Commit af4d9f2

Browse files
authored
Merge pull request #59 from cmushroom/dev
2.5.1
2 parents 51be662 + 35acddf commit af4d9f2

34 files changed

+420
-684
lines changed

.DS_Store

0 Bytes
Binary file not shown.

.version

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"latestVersionNum": 19,
3-
"latestVersion": "2.5.0",
2+
"latestVersionNum": 20,
3+
"latestVersion": "2.5.1",
44
"updateType": "hint",
5-
"releaseNotes": "1. 解决失焦后重新获取焦点tab切换问题,同时解决了最小化到dock唤起的问题 #55 #38。 \n2. 增加用户名登录。"
5+
"releaseNotes": "1. 修复低版本用户名问题。"
66
}
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//
2+
// RedisClientBaseTest.swift
3+
// Tests
4+
//
5+
// Created by chengpan on 2022/12/3.
6+
//
7+
8+
import XCTest
9+
10+
open class RedisBaseTest: XCTestCase {
11+
open var redisHostname: String {
12+
return ProcessInfo.processInfo.environment["REDIS_HOST"] ?? "localhost"
13+
}
14+
15+
open var redisPort: Int {
16+
return Int(ProcessInfo.processInfo.environment["REDIS_PORT"] ?? "6379")!
17+
}
18+
19+
open var redisUsername: String? {
20+
return ProcessInfo.processInfo.environment["REDIS_USERNAME"]
21+
}
22+
23+
open var redisPassword: String? {
24+
return ProcessInfo.processInfo.environment["REDIS_PW"]
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//
2+
// RedisClientBaseTests.swift
3+
// Tests
4+
//
5+
// Created by chengpan on 2022/12/3.
6+
//
7+
8+
@testable import redis_pro
9+
import XCTest
10+
import Foundation
11+
import Logging
12+
13+
open class RedisClientBaseTest: RedisBaseTest {
14+
let logger = Logger(label: "redis-client-test")
15+
16+
var redisClient: RediStackClient!
17+
18+
open override func setUp() {
19+
logger.info("redis client base test setUp...")
20+
redisClient = .init(RedisModel(host: redisHostname, port: redisPort, username: redisUsername, password: redisPassword))
21+
// let conn = try await redisClient.initConn(host: redisHostname, port: redisPort, username: redisUsername ?? "", pass: redisPassword ?? "", database: 0)
22+
}
23+
24+
/// Sends a "FLUSHALL" command to Redis to clear it of any data from the previous test, then closes the connection.
25+
///
26+
/// If any steps fail, a `fatalError` is thrown.
27+
///
28+
/// See `XCTest.XCTestCase.tearDown()`
29+
open override func tearDown() {
30+
// Task {
31+
// await redisClient.flushDB()
32+
// }
33+
34+
redisClient.close()
35+
}
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//
2+
// RedisClent.swift
3+
// Tests
4+
//
5+
// Created by chengpan on 2022/12/3.
6+
//
7+
8+
@testable import redis_pro
9+
import XCTest
10+
import Foundation
11+
12+
class RedisClentStringTest: RedisClientBaseTest {
13+
let key = "redis_client_test_key"
14+
let value = "redis_client_test_value"
15+
16+
func testSetKey() async {
17+
await redisClient.set(key, value: value)
18+
}
19+
20+
func testGetKey() async {
21+
await testSetKey()
22+
let r = await redisClient.get(key)
23+
24+
logger.info("redis client test get key, r: \(r)")
25+
XCTAssertEqual(value, r)
26+
}
27+
}

redis-proTests/redis_proTests.swift Tests/Tests.swift

+4-15
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
//
2-
// redis_proTests.swift
3-
// redis-proTests
2+
// Tests.swift
3+
// Tests
44
//
5-
// Created by chenpanwang on 2022/1/6.
5+
// Created by chengpan on 2022/12/3.
66
//
77

88
import XCTest
9-
import RediStack
10-
@testable import redis_pro
119

12-
class redis_proTests: XCTestCase {
10+
final class Tests: XCTestCase {
1311

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

2220
func testExample() throws {
23-
24-
// defer {
25-
// instance.getClient().close()
26-
// }
27-
//
28-
29-
30-
//
31-
3221
// This is an example of a functional test case.
3322
// Use XCTAssert and related functions to verify your tests produce the correct results.
3423
// Any test you write for XCTest can be annotated as throws and async.

redis-pro.xcodeproj/project.pbxproj

+146-128
Large diffs are not rendered by default.

redis-pro.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

+11-11
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
{
44
"identity" : "appcenter-sdk-apple",
55
"kind" : "remoteSourceControl",
6-
"location" : "https://gitee.com/chengpan168_admin/appcenter-sdk-apple.git",
6+
"location" : "https://github.com/microsoft/appcenter-sdk-apple.git",
77
"state" : {
8-
"revision" : "25f64229373de97ff3920941cd52203193e5d8be",
9-
"version" : "4.3.0"
8+
"revision" : "88e65475ffd3a7cf2bbde07df9e62159a1fd60a8",
9+
"version" : "5.0.0"
1010
}
1111
},
1212
{
@@ -23,26 +23,26 @@
2323
"kind" : "remoteSourceControl",
2424
"location" : "https://github.com/microsoft/PLCrashReporter.git",
2525
"state" : {
26-
"revision" : "6b27393cad517c067dceea85fadf050e70c4ceaa",
27-
"version" : "1.10.1"
26+
"revision" : "b1a342da19ed9b3af61ea2efa7656c2af30aeb7c",
27+
"version" : "1.11.0"
2828
}
2929
},
3030
{
3131
"identity" : "puppy",
3232
"kind" : "remoteSourceControl",
3333
"location" : "https://github.com/sushichop/Puppy.git",
3434
"state" : {
35-
"revision" : "7cfae42becac2d8916cb1a866dd12d9843199df9",
36-
"version" : "0.5.0"
35+
"revision" : "9f3cf02dc92bc233e40ba8a66af20abb97978929",
36+
"version" : "0.6.0"
3737
}
3838
},
3939
{
4040
"identity" : "redistack",
4141
"kind" : "remoteSourceControl",
4242
"location" : "https://github.com/chengpan168/RediStack",
4343
"state" : {
44-
"branch" : "feat/username",
45-
"revision" : "fd298674d753396482e029d0628a7c82316ea199"
44+
"branch" : "feat/user",
45+
"revision" : "07a005e97530334efec8ed4b5c96a91e2b45c3f5"
4646
}
4747
},
4848
{
@@ -113,8 +113,8 @@
113113
"kind" : "remoteSourceControl",
114114
"location" : "https://github.com/apple/swift-log.git",
115115
"state" : {
116-
"revision" : "5d66f7ba25daf4f94100e7022febf3c75e37a6c7",
117-
"version" : "1.4.2"
116+
"revision" : "6fe203dc33195667ce1759bf0182975e4653ba1c",
117+
"version" : "1.4.4"
118118
}
119119
},
120120
{

redis-pro.xcodeproj/xcshareddata/xcschemes/redis-pro.xcscheme

+8-7
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,20 @@
4747
skipped = "NO">
4848
<BuildableReference
4949
BuildableIdentifier = "primary"
50-
BlueprintIdentifier = "CE0290D2278707280058442B"
51-
BuildableName = "redis-proTests.xctest"
52-
BlueprintName = "redis-proTests"
50+
BlueprintIdentifier = "4301C85826BBEB5000C08E19"
51+
BuildableName = "redisProUnitTests.xctest"
52+
BlueprintName = "redisProUnitTests"
5353
ReferencedContainer = "container:redis-pro.xcodeproj">
5454
</BuildableReference>
5555
</TestableReference>
5656
<TestableReference
57-
skipped = "NO">
57+
skipped = "NO"
58+
parallelizable = "YES">
5859
<BuildableReference
5960
BuildableIdentifier = "primary"
60-
BlueprintIdentifier = "4301C85826BBEB5000C08E19"
61-
BuildableName = "redisProUnitTests.xctest"
62-
BlueprintName = "redisProUnitTests"
61+
BlueprintIdentifier = "62BDAB2A293B040C00ADA406"
62+
BuildableName = "Tests.xctest"
63+
BlueprintName = "Tests"
6364
ReferencedContainer = "container:redis-pro.xcodeproj">
6465
</BuildableReference>
6566
</TestableReference>

redis-pro.xcodeproj/xcuserdata/chengpan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

-16
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,5 @@
8484
landmarkType = "7">
8585
</BreakpointContent>
8686
</BreakpointProxy>
87-
<BreakpointProxy
88-
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
89-
<BreakpointContent
90-
uuid = "D30A974A-E026-4F0F-9798-3DCF3A9D1159"
91-
shouldBeEnabled = "No"
92-
ignoreCount = "0"
93-
continueAfterRunningActions = "No"
94-
filePath = "redis-pro/Common/RedisClient/RediStackClient.swift"
95-
startingColumnNumber = "9223372036854775807"
96-
endingColumnNumber = "9223372036854775807"
97-
startingLineNumber = "232"
98-
endingLineNumber = "232"
99-
landmarkName = "initConn(host:port:username:pass:database:)"
100-
landmarkType = "7">
101-
</BreakpointContent>
102-
</BreakpointProxy>
10387
</Breakpoints>
10488
</Bucket>

redis-pro.xcodeproj/xcuserdata/chengpan.xcuserdatad/xcschemes/xcschememanagement.plist

+30-9
Original file line numberDiff line numberDiff line change
@@ -9,56 +9,77 @@
99
<key>isShown</key>
1010
<false/>
1111
<key>orderHint</key>
12-
<integer>6</integer>
12+
<integer>10</integer>
1313
</dict>
1414
<key>CustomDump (Playground) 2.xcscheme</key>
1515
<dict>
1616
<key>isShown</key>
1717
<false/>
1818
<key>orderHint</key>
19-
<integer>7</integer>
19+
<integer>13</integer>
2020
</dict>
2121
<key>CustomDump (Playground) 3.xcscheme</key>
2222
<dict>
2323
<key>isShown</key>
2424
<false/>
2525
<key>orderHint</key>
26-
<integer>25</integer>
26+
<integer>11</integer>
2727
</dict>
2828
<key>CustomDump (Playground) 4.xcscheme</key>
2929
<dict>
3030
<key>isShown</key>
3131
<false/>
3232
<key>orderHint</key>
33-
<integer>26</integer>
33+
<integer>12</integer>
3434
</dict>
3535
<key>CustomDump (Playground) 5.xcscheme</key>
3636
<dict>
3737
<key>isShown</key>
3838
<false/>
3939
<key>orderHint</key>
40-
<integer>27</integer>
40+
<integer>14</integer>
41+
</dict>
42+
<key>CustomDump (Playground) 6.xcscheme</key>
43+
<dict>
44+
<key>isShown</key>
45+
<false/>
46+
<key>orderHint</key>
47+
<integer>28</integer>
48+
</dict>
49+
<key>CustomDump (Playground) 7.xcscheme</key>
50+
<dict>
51+
<key>isShown</key>
52+
<false/>
53+
<key>orderHint</key>
54+
<integer>29</integer>
55+
</dict>
56+
<key>CustomDump (Playground) 8.xcscheme</key>
57+
<dict>
58+
<key>isShown</key>
59+
<false/>
60+
<key>orderHint</key>
61+
<integer>30</integer>
4162
</dict>
4263
<key>CustomDump (Playground).xcscheme</key>
4364
<dict>
4465
<key>isShown</key>
4566
<false/>
4667
<key>orderHint</key>
47-
<integer>5</integer>
68+
<integer>8</integer>
4869
</dict>
4970
<key>Playground (Playground) 1.xcscheme</key>
5071
<dict>
5172
<key>isShown</key>
5273
<false/>
5374
<key>orderHint</key>
54-
<integer>9</integer>
75+
<integer>20</integer>
5576
</dict>
5677
<key>Playground (Playground) 2.xcscheme</key>
5778
<dict>
5879
<key>isShown</key>
5980
<false/>
6081
<key>orderHint</key>
61-
<integer>10</integer>
82+
<integer>22</integer>
6283
</dict>
6384
<key>Playground (Playground) 3.xcscheme</key>
6485
<dict>
@@ -86,7 +107,7 @@
86107
<key>isShown</key>
87108
<false/>
88109
<key>orderHint</key>
89-
<integer>8</integer>
110+
<integer>17</integer>
90111
</dict>
91112
<key>PromiseKit (Playground) 1.xcscheme</key>
92113
<dict>

redis-pro/Command/AbountCommand.swift

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//
2+
// AbountCommand.swift
3+
// redis-pro
4+
//
5+
// Created by chengpan on 2022/12/3.
6+
//
7+
8+
import Foundation
9+
import SwiftUI
10+
11+
struct AboutCommands: View {
12+
13+
@Environment(\.openURL) var openURL
14+
var body: some View {
15+
Button("About") {
16+
guard let url = URL(string: "redis-pro://AboutView") else {
17+
return
18+
}
19+
openURL(url)
20+
}
21+
}
22+
}
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// CheckUpdateCommand.swift
3+
// redis-pro
4+
//
5+
// Created by chengpan on 2022/12/3.
6+
//
7+
8+
import SwiftUI
9+
import Foundation
10+
11+
struct CheckUpdateCommands: View {
12+
var body: some View {
13+
Button("Check Update") {
14+
VersionManager().checkUpdate(isNoUpgradeHint: true)
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)