Skill update round trip / roundtrip (false, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, latest) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
29 lines
1005 B
Swift
29 lines
1005 B
Swift
import OrcaComputerUseMacOSCore
|
|
import XCTest
|
|
|
|
final class ComputerSnapshotCachePolicyTests: XCTestCase {
|
|
func testDoesNotExpireFreshSnapshotsAtTheAgeBoundary() {
|
|
let createdAt = Date(timeIntervalSince1970: 100)
|
|
let now = createdAt.addingTimeInterval(ComputerSnapshotCachePolicy.maxAge)
|
|
|
|
XCTAssertFalse(ComputerSnapshotCachePolicy.isExpired(createdAt: createdAt, now: now))
|
|
}
|
|
|
|
func testExpiresSnapshotsOlderThanTheAgeLimit() {
|
|
let createdAt = Date(timeIntervalSince1970: 100)
|
|
let now = createdAt.addingTimeInterval(ComputerSnapshotCachePolicy.maxAge + 0.001)
|
|
|
|
XCTAssertTrue(ComputerSnapshotCachePolicy.isExpired(createdAt: createdAt, now: now))
|
|
}
|
|
|
|
func testPrunesWhenCacheExceedsEntryLimit() {
|
|
XCTAssertTrue(
|
|
ComputerSnapshotCachePolicy.shouldPrune(
|
|
entryCount: ComputerSnapshotCachePolicy.maxEntries + 1,
|
|
createdAt: Date(),
|
|
now: Date()
|
|
)
|
|
)
|
|
}
|
|
}
|