Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

1005 B
Raw Blame
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()
            )
        )
    }
}