From 2e38f6655a988220999245ce6910674818207b87 Mon Sep 17 00:00:00 2001 From: Kyaw Monkey Date: Sun, 14 Jun 2026 22:02:36 +0700 Subject: [PATCH 1/6] removed unnecessary FrameDiffWriter instance in independentCaches test --- Tests/TUIkitTests/FrameDiffWriterTests.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/Tests/TUIkitTests/FrameDiffWriterTests.swift b/Tests/TUIkitTests/FrameDiffWriterTests.swift index 3f25db46..df0172ec 100644 --- a/Tests/TUIkitTests/FrameDiffWriterTests.swift +++ b/Tests/TUIkitTests/FrameDiffWriterTests.swift @@ -191,8 +191,6 @@ struct DiffIntegrationTests { @Test("Content and status bar caches are independent") func independentCaches() { - let writer = FrameDiffWriter() - // Simulate writing content + status bar (using internal state check) let contentLines = ["Content1", "Content2"] let statusLines = ["Status1"] From b6bb3e4713c44613a46ef33cb767c6d4bb95e9d7 Mon Sep 17 00:00:00 2001 From: Kyaw Monkey Date: Sun, 14 Jun 2026 22:03:24 +0700 Subject: [PATCH 2/6] update deprecated `ProgressBarStyle` to `TrackStyle` in ProgressViewStyleTests.allStylesCorrectWidth test --- Tests/TUIkitTests/ProgressViewTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TUIkitTests/ProgressViewTests.swift b/Tests/TUIkitTests/ProgressViewTests.swift index f0714a00..a731c585 100644 --- a/Tests/TUIkitTests/ProgressViewTests.swift +++ b/Tests/TUIkitTests/ProgressViewTests.swift @@ -198,7 +198,7 @@ struct ProgressViewStyleTests { @Test("All styles render correct width") func allStylesCorrectWidth() { - let styles: [ProgressBarStyle] = [.block, .blockFine, .shade, .bar, .dot] + let styles: [TrackStyle] = [.block, .blockFine, .shade, .bar, .dot] let context = testContext(width: 20) for style in styles { From 6cbbf858668063ffc9e6078bb329b9610ba8e861 Mon Sep 17 00:00:00 2001 From: Kyaw Monkey Date: Sun, 14 Jun 2026 22:04:31 +0700 Subject: [PATCH 3/6] remove duplicated AppState.shared.needsRender in StatePropertyWrapperTests.stateTriggerRender test --- Tests/TUIkitTests/StatePropertyTests.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Tests/TUIkitTests/StatePropertyTests.swift b/Tests/TUIkitTests/StatePropertyTests.swift index 95749dee..842ad30e 100644 --- a/Tests/TUIkitTests/StatePropertyTests.swift +++ b/Tests/TUIkitTests/StatePropertyTests.swift @@ -32,7 +32,6 @@ struct StatePropertyWrapperTests { func stateTriggerRender() { // StateBox.didSet calls AppState.shared.setNeedsRender(). // We mutate and check that the shared instance is marked as needing render. - let initialNeedsRender = AppState.shared.needsRender let state = State(wrappedValue: "initial") state.wrappedValue = "changed" let triggered = AppState.shared.needsRender From eb0d7666f1ee4d3afc9ab21440e8407cb32ca961 Mon Sep 17 00:00:00 2001 From: Kyaw Monkey Date: Sun, 14 Jun 2026 22:14:42 +0700 Subject: [PATCH 4/6] update RenderBottleneckTests to silence warnings --- Tests/TUIkitTests/RenderBottleneckTests.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Tests/TUIkitTests/RenderBottleneckTests.swift b/Tests/TUIkitTests/RenderBottleneckTests.swift index d9645d2c..3204391a 100644 --- a/Tests/TUIkitTests/RenderBottleneckTests.swift +++ b/Tests/TUIkitTests/RenderBottleneckTests.swift @@ -25,6 +25,7 @@ struct RenderBottleneckTests { /// Uses `Date` instead of `CFAbsoluteTimeGetCurrent` because CoreFoundation /// timing functions are not available on Linux. The precision difference /// is negligible for performance benchmarks at millisecond granularity. + @discardableResult private func measure(_ name: String, iterations: Int = 1000, block: () -> Void) -> TimeInterval { let start = Date() for _ in 0.. Date: Sun, 14 Jun 2026 22:20:50 +0700 Subject: [PATCH 5/6] clean up SecureFieldTests.onSubmitStoresAction --- Tests/TUIkitTests/SecureFieldTests.swift | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Tests/TUIkitTests/SecureFieldTests.swift b/Tests/TUIkitTests/SecureFieldTests.swift index d1a863d3..df53771f 100644 --- a/Tests/TUIkitTests/SecureFieldTests.swift +++ b/Tests/TUIkitTests/SecureFieldTests.swift @@ -173,12 +173,9 @@ struct SecureFieldTests { @Test("SecureField onSubmit modifier stores action") func onSubmitStoresAction() { - var text = "" - var submitted = false - let binding = Binding(get: { text }, set: { text = $0 }) + let binding = Binding(get: { "" }, set: { _ in }) - let secureField = SecureField("Password", text: binding) - .onSubmit { submitted = true } + let secureField = SecureField("Password", text: binding).onSubmit { } #expect(secureField.onSubmitAction != nil) } From 3d4ca4c71d290cc82e75b1ad4de82daab80e5ccd Mon Sep 17 00:00:00 2001 From: Kyaw Monkey Date: Sun, 14 Jun 2026 22:23:28 +0700 Subject: [PATCH 6/6] enhance LifecycleManaterTests.cancelTask, added assertion for task cancellation --- Tests/TUIkitTests/LifecycleManagerTests.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tests/TUIkitTests/LifecycleManagerTests.swift b/Tests/TUIkitTests/LifecycleManagerTests.swift index ba0a9518..e6336ad3 100644 --- a/Tests/TUIkitTests/LifecycleManagerTests.swift +++ b/Tests/TUIkitTests/LifecycleManagerTests.swift @@ -218,12 +218,13 @@ struct LifecycleManagerTaskTests { nonisolated(unsafe) var wasCancelled = false manager.startTask(token: "task-1", priority: .medium) { // Long-running task that checks cancellation - try? await Task.sleep(for: .seconds(10)) + try? await Task.sleep(for: .milliseconds(100)) wasCancelled = Task.isCancelled } // Cancel immediately manager.cancelTask(token: "task-1") try await Task.sleep(for: .milliseconds(50)) + #expect(wasCancelled == true) // Task was cancelled, so it either didn't complete the sleep // or Task.isCancelled was true. Either way the task is cancelled. // We can't easily observe the internal state, but cancellation was requested.