Files
openclaw/apps/shared/OpenClawKit/Tests/OpenClawKitTests/TalkHistoryTimestampTests.swift

17 lines
679 B
Swift
Raw Normal View History

import XCTest
2026-01-30 03:15:10 +01:00
@testable import OpenClawKit
final class TalkHistoryTimestampTests: XCTestCase {
func testSecondsTimestampsAreAcceptedWithSmallTolerance() {
XCTAssertTrue(TalkHistoryTimestamp.isAfter(999.6, sinceSeconds: 1000))
XCTAssertFalse(TalkHistoryTimestamp.isAfter(999.4, sinceSeconds: 1000))
}
func testMillisecondsTimestampsAreAcceptedWithSmallTolerance() {
let sinceSeconds = 1_700_000_000.0
let sinceMs = sinceSeconds * 1000
XCTAssertTrue(TalkHistoryTimestamp.isAfter(sinceMs - 500, sinceSeconds: sinceSeconds))
XCTAssertFalse(TalkHistoryTimestamp.isAfter(sinceMs - 501, sinceSeconds: sinceSeconds))
}
}