Skip to content

Commit

Permalink
Merge pull request #67 from cmushroom/dev
Browse files Browse the repository at this point in the history
3.1.0
  • Loading branch information
chengpan168 committed Jan 14, 2024
2 parents 214d4e8 + 46600a2 commit 283fec2
Show file tree
Hide file tree
Showing 51 changed files with 868 additions and 886 deletions.
6 changes: 3 additions & 3 deletions .version
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"latestVersionNum": 30,
"latestVersion": "3.0.0",
"latestVersionNum": 31,
"latestVersion": "3.1.0",
"updateType": "hint",
"releaseNotes": "1. 升级TCA,使用Reducer重写store 部分。\n2. 增加快速分页模式, 在查询结果数据量较大情况时,优化查询性能。"
"releaseNotes": "1. 增加批量删除功能。\n2. 编辑器样式调整。\n3. 修复查询空时, table select index 数值异常问题。 \n4. 刷新按钮时使用当前查询关键字。 \n5. 修复查询空时, table select index 数值异常问题。\n6. 优化查询时loading中断问题。\n7. 使用async优化确认框。"
}
38 changes: 38 additions & 0 deletions Tests/Store/AppContextStoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,43 @@ class AppContextStoreTests: StoreBaseTests {
$0.loading = true
$0.loadingCount = 1
}
await store.send(.hide) {
$0.loading = false
$0.loadingCount = 0
}

await store.send(.show) {
$0.loading = true
$0.loadingCount = 1
}
await store.send(.show) {
$0.loading = true
$0.loadingCount = 2
}
await store.send(.show) {
$0.loading = true
$0.loadingCount = 3
}
await store.send(.hide) {
$0.loading = true
$0.loadingCount = 2
}
await store.send(.show) {
$0.loading = true
$0.loadingCount = 3
}
await store.send(.hide) {
$0.loading = true
$0.loadingCount = 2
}
await store.send(.hide) {
$0.loading = true
$0.loadingCount = 1
}
await store.send(.hide) {
$0.loading = false
$0.loadingCount = 0
}
await store.send(.hide)
}
}
18 changes: 13 additions & 5 deletions Tests/Store/KeysDelStoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,23 @@ import ComposableArchitecture
@MainActor
class KeysDelStoreTests: StoreBaseTests {
func testBasics() async {
let store = TestStore(initialState: KeysDelStore.State()) {
KeysDelStore()
let store = TestStore(initialState: RedisKeysStore.State()) {
RedisKeysStore()
} withDependencies: {
$0.redisInstance = redisInstance
$0.redisClient = redisClient
}

// await store.send(.favoriteAction(.connectSuccess(self.redisModel))) {
// $0.isConnect = true
// }

await redisClient.set("__keys_del_str_1", value: UUID.init().uuidString)
await redisClient.set("__keys_del_str_2", value: UUID.init().uuidString)
await redisClient.set("__keys_del_str_3", value: UUID.init().uuidString)
await redisClient.set("__keys_del_str_4", value: UUID.init().uuidString)
await redisClient.set("__keys_del_str_5", value: UUID.init().uuidString)
await store.send(.search("__keys_del_str_*")) {
$0.pageState = PageStore.State()
}

XCTAssertEqual(store.state.tableState.datasource.count, 3)
}
}
34 changes: 34 additions & 0 deletions Tests/Store/RedisKeysStoreTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// RedisKeysStoreTest.swift
// Tests
//
// Created by chengpan on 2024/1/1.
//

@testable import redis_pro
import Foundation
import XCTest
import ComposableArchitecture

@MainActor
class RedisKeysStoreTests: StoreBaseTests {
func testBasics() async {
let store = TestStore(initialState: RedisKeysStore.State()) {
RedisKeysStore()
} withDependencies: {
$0.redisClient = redisClient
}


await redisClient.set("__keys_del_str_1", value: UUID.init().uuidString)
await redisClient.set("__keys_del_str_2", value: UUID.init().uuidString)
await redisClient.set("__keys_del_str_3", value: UUID.init().uuidString)
await redisClient.set("__keys_del_str_4", value: UUID.init().uuidString)
await redisClient.set("__keys_del_str_5", value: UUID.init().uuidString)
await store.send(.search("__keys_del_str_*"))

// await store.receive(\.setKeys)

XCTAssertEqual(store.state.tableState.datasource.count, 5)
}
}
1 change: 1 addition & 0 deletions Tests/Store/StoreBaseTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class StoreBaseTests: RedisClientBaseTest {
override func setUp() {
super.setUp()
self.redisInstance = RedisInstanceModel(redisModel: redisModel)

logger.info("StoreBaseTests setup...")
}

Expand Down
51 changes: 37 additions & 14 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 @@ -59,8 +59,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-case-paths",
"state" : {
"revision" : "5da6989aae464f324eef5c5b52bdb7974725ab81",
"version" : "1.0.0"
"revision" : "a5521dde99570789d8cb7c43e51418d7cd1a87ca",
"version" : "1.1.2"
}
},
{
Expand All @@ -86,17 +86,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-composable-architecture",
"state" : {
"revision" : "a7c1f799b55ecb418f85094b142565834f7ee7c7",
"version" : "1.2.0"
"revision" : "ae491c9e3f66631e72d58db8bb4c27dfc3d3afd4",
"version" : "1.6.0"
}
},
{
"identity" : "swift-concurrency-extras",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-concurrency-extras",
"state" : {
"revision" : "ea631ce892687f5432a833312292b80db238186a",
"version" : "1.0.0"
"revision" : "bb5059bde9022d69ac516803f4f227d8ac967f71",
"version" : "1.1.0"
}
},
{
Expand All @@ -122,8 +122,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-dependencies",
"state" : {
"revision" : "4e1eb6e28afe723286d8cc60611237ffbddba7c5",
"version" : "1.0.0"
"revision" : "9783b58167f7618cb86011156e741cbc6f4cc864",
"version" : "1.1.2"
}
},
{
Expand Down Expand Up @@ -180,13 +180,22 @@
"version" : "1.2.1"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax",
"state" : {
"revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036",
"version" : "509.0.2"
}
},
{
"identity" : "swiftui-navigation",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swiftui-navigation",
"state" : {
"revision" : "905274b2bd98be556d2cfcf31b94d5979b924755",
"version" : "1.0.1"
"revision" : "78f9d72cf667adb47e2040aa373185c88c63f0dc",
"version" : "1.2.0"
}
},
{
Expand Down
Binary file not shown.
Loading

0 comments on commit 283fec2

Please sign in to comment.