mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
test: add additional checks to scroll above cross-page test
Reveals a memory corruption issue caused by the direct assignment of `cursor.page_pin` instead of using the `cursorChangePin` method.
This commit is contained in:
@ -4477,6 +4477,15 @@ test "Screen: scroll above same page but cursor on previous page last row" {
|
|||||||
try testing.expect(!s.pages.isDirty(.{ .active = .{ .x = 0, .y = 0 } }));
|
try testing.expect(!s.pages.isDirty(.{ .active = .{ .x = 0, .y = 0 } }));
|
||||||
try testing.expect(s.pages.isDirty(.{ .active = .{ .x = 0, .y = 1 } }));
|
try testing.expect(s.pages.isDirty(.{ .active = .{ .x = 0, .y = 1 } }));
|
||||||
try testing.expect(s.pages.isDirty(.{ .active = .{ .x = 0, .y = 2 } }));
|
try testing.expect(s.pages.isDirty(.{ .active = .{ .x = 0, .y = 2 } }));
|
||||||
|
|
||||||
|
// Attempt to clear the style from the cursor and
|
||||||
|
// then assert the integrity of both of our pages.
|
||||||
|
//
|
||||||
|
// This catches a case of memory corruption where the cursor
|
||||||
|
// is moved between pages without accounting for style refs.
|
||||||
|
try s.setAttribute(.{ .reset_bg = {} });
|
||||||
|
s.pages.pages.first.?.data.assertIntegrity();
|
||||||
|
s.pages.pages.last.?.data.assertIntegrity();
|
||||||
}
|
}
|
||||||
|
|
||||||
test "Screen: scroll above creates new page" {
|
test "Screen: scroll above creates new page" {
|
||||||
|
Reference in New Issue
Block a user