Add further scrollback option for longer terminal history
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import XCTest
|
||||
@testable import CommandNotch
|
||||
|
||||
final class TerminalScrollbackEstimatorTests: XCTestCase {
|
||||
func testEstimateIncreasesAsScrollbackGrows() {
|
||||
let small = TerminalScrollbackEstimator.estimate(
|
||||
scrollbackLines: 5_000,
|
||||
fontSize: 13,
|
||||
openWidth: 640,
|
||||
openHeight: 350
|
||||
)
|
||||
let large = TerminalScrollbackEstimator.estimate(
|
||||
scrollbackLines: 100_000,
|
||||
fontSize: 13,
|
||||
openWidth: 640,
|
||||
openHeight: 350
|
||||
)
|
||||
|
||||
XCTAssertGreaterThan(large.bytes, small.bytes)
|
||||
XCTAssertGreaterThan(large.columns, 0)
|
||||
XCTAssertGreaterThan(large.rows, 0)
|
||||
}
|
||||
|
||||
func testEstimateClampsNegativeScrollbackToZero() {
|
||||
let estimate = TerminalScrollbackEstimator.estimate(
|
||||
scrollbackLines: -1_000,
|
||||
fontSize: 13,
|
||||
openWidth: 640,
|
||||
openHeight: 350
|
||||
)
|
||||
|
||||
XCTAssertGreaterThan(estimate.bytes, 0)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user