498f407585
Introduce optional Apple account-backed credits with scoped gateway access while preserving local and BYOK paths. Refresh assistant behavior, tests, privacy disclosures, docs, and the website for the 2.0 experience.
34 lines
949 B
Swift
34 lines
949 B
Swift
// KeyboardExtensionMemoryBudgetTests.swift
|
|
// OSGKeyboardTests
|
|
|
|
@testable import OSGKeyboardShared
|
|
import XCTest
|
|
|
|
final class KeyboardExtensionMemoryBudgetTests: XCTestCase {
|
|
func testMemoryLevelsUseDocumentedBoundaries() {
|
|
XCTAssertEqual(
|
|
KeyboardExtensionMemoryBudget.level(forPhysFootprintMB: 35.9),
|
|
.normal
|
|
)
|
|
XCTAssertEqual(
|
|
KeyboardExtensionMemoryBudget.level(forPhysFootprintMB: 36),
|
|
.warning
|
|
)
|
|
XCTAssertEqual(
|
|
KeyboardExtensionMemoryBudget.level(forPhysFootprintMB: 40),
|
|
.high
|
|
)
|
|
XCTAssertEqual(
|
|
KeyboardExtensionMemoryBudget.level(forPhysFootprintMB: 48),
|
|
.critical
|
|
)
|
|
}
|
|
|
|
func testUnavailableFootprintIsNotMisclassifiedAsSafe() {
|
|
XCTAssertEqual(
|
|
KeyboardExtensionMemoryBudget.level(forPhysFootprintMB: -1),
|
|
.unavailable
|
|
)
|
|
}
|
|
}
|