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:
Qwerasd
2024-12-25 20:06:48 -05:00
parent 7027147c76
commit a387e680ed

View File

@ -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 = 1 } }));
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" {