mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
terminal/new: couple missing tests
This commit is contained in:
@ -5141,6 +5141,7 @@ test "Terminal: deleteChars split wide character tail" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// X
|
||||||
test "Terminal: eraseChars resets pending wrap" {
|
test "Terminal: eraseChars resets pending wrap" {
|
||||||
const alloc = testing.allocator;
|
const alloc = testing.allocator;
|
||||||
var t = try init(alloc, 5, 5);
|
var t = try init(alloc, 5, 5);
|
||||||
@ -5159,6 +5160,7 @@ test "Terminal: eraseChars resets pending wrap" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// X
|
||||||
test "Terminal: eraseChars resets wrap" {
|
test "Terminal: eraseChars resets wrap" {
|
||||||
const alloc = testing.allocator;
|
const alloc = testing.allocator;
|
||||||
var t = try init(alloc, 5, 5);
|
var t = try init(alloc, 5, 5);
|
||||||
|
@ -2848,6 +2848,54 @@ test "Terminal: eraseChars wide character" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test "Terminal: eraseChars resets pending wrap" {
|
||||||
|
const alloc = testing.allocator;
|
||||||
|
var t = try init(alloc, 5, 5);
|
||||||
|
defer t.deinit(alloc);
|
||||||
|
|
||||||
|
for ("ABCDE") |c| try t.print(c);
|
||||||
|
try testing.expect(t.screen.cursor.pending_wrap);
|
||||||
|
t.eraseChars(1);
|
||||||
|
try testing.expect(!t.screen.cursor.pending_wrap);
|
||||||
|
try t.print('X');
|
||||||
|
|
||||||
|
{
|
||||||
|
const str = try t.plainString(testing.allocator);
|
||||||
|
defer testing.allocator.free(str);
|
||||||
|
try testing.expectEqualStrings("ABCDX", str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
test "Terminal: eraseChars resets wrap" {
|
||||||
|
const alloc = testing.allocator;
|
||||||
|
var t = try init(alloc, 5, 5);
|
||||||
|
defer t.deinit(alloc);
|
||||||
|
|
||||||
|
for ("ABCDE123") |c| try t.print(c);
|
||||||
|
{
|
||||||
|
const list_cell = t.screen.pages.getCell(.{ .active = .{ .x = 0, .y = 0 } }).?;
|
||||||
|
const row = list_cell.row;
|
||||||
|
try testing.expect(row.wrap);
|
||||||
|
}
|
||||||
|
|
||||||
|
t.setCursorPos(1, 1);
|
||||||
|
t.eraseChars(1);
|
||||||
|
|
||||||
|
{
|
||||||
|
const list_cell = t.screen.pages.getCell(.{ .active = .{ .x = 0, .y = 0 } }).?;
|
||||||
|
const row = list_cell.row;
|
||||||
|
try testing.expect(!row.wrap);
|
||||||
|
}
|
||||||
|
|
||||||
|
try t.print('X');
|
||||||
|
|
||||||
|
{
|
||||||
|
const str = try t.plainString(testing.allocator);
|
||||||
|
defer testing.allocator.free(str);
|
||||||
|
try testing.expectEqualStrings("XBCDE\n123", str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
test "Terminal: reverseIndex" {
|
test "Terminal: reverseIndex" {
|
||||||
const alloc = testing.allocator;
|
const alloc = testing.allocator;
|
||||||
var t = try init(alloc, 2, 5);
|
var t = try init(alloc, 2, 5);
|
||||||
|
Reference in New Issue
Block a user