Skip to content

Commit b395324

Browse files
leoho0722claude
andcommitted
fix: 修正 countdownString_minutesOnly 測試因時間誤差導致 CI 失敗
加入 30 秒緩衝,避免 DateComponentsFormatter 因毫秒級誤差將 45 分鐘捨入為 44m。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7bf0c57 commit b395324

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Packages/AgenticCore/Tests/AgenticCoreTests/Models/Codex/CodexUsageSummaryTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ struct CodexUsageSummaryTests {
173173
/// 驗證倒數時間僅有分鐘時回傳非 nil 且包含數字
174174
@Test
175175
func countdownString_minutesOnly() {
176-
let future = Date().addingTimeInterval(45 * 60) // 45 minutes
176+
// 多加 30 秒緩衝,避免因毫秒誤差導致分鐘少 1
177+
let future = Date().addingTimeInterval(45 * 60 + 30)
177178
let result = future.countdownString
178179
#expect(result != nil)
179180
#expect(result!.contains("45"))

0 commit comments

Comments
 (0)