Files
Luma/Tests/ArchiveMessageBatchPolicyTests.swift
2026-07-30 20:07:51 +07:00

23 lines
853 B
Swift

import XCTest
@testable import Luma
final class ArchiveMessageBatchPolicyTests: XCTestCase {
func testMamPagesStaySmallEnoughForInteractiveUI() {
XCTAssertLessThanOrEqual(ArchiveMessageBatchPolicy.pageSize, 32)
XCTAssertGreaterThan(ArchiveMessageBatchPolicy.pageSize, 0)
}
func testOnlyOneStanzaIsDecodedPerMainActorSlice() {
XCTAssertEqual(ArchiveMessageBatchPolicy.decodeSliceSize, 1)
XCTAssertGreaterThan(ArchiveMessageBatchPolicy.interSliceDelayNanoseconds, 0)
}
func testInboxCanHoldAProtocolViolatingDoublePageWithoutGrowingForever() {
XCTAssertGreaterThanOrEqual(
ArchiveMessageBatchPolicy.maximumBufferedStanzas,
ArchiveMessageBatchPolicy.pageSize * 2
)
XCTAssertLessThanOrEqual(ArchiveMessageBatchPolicy.maximumBufferedStanzas, 128)
}
}