terminal: extended reverse wrap takes priority over reverse wrap

This commit is contained in:
Mitchell Hashimoto
2023-10-06 08:59:22 -07:00
parent a1becf73ad
commit d3483a8eed

View File

@ -3488,3 +3488,26 @@ test "Terminal: cursorLeft extended reverse wrap bottom wraparound" {
try testing.expectEqualStrings("ABCDE\n1\n X", str); try testing.expectEqualStrings("ABCDE\n1\n X", str);
} }
} }
test "Terminal: cursorLeft extended reverse wrap is priority if both set" {
const alloc = testing.allocator;
var t = try init(alloc, 5, 3);
defer t.deinit(alloc);
t.modes.set(.wraparound, true);
t.modes.set(.reverse_wrap, true);
t.modes.set(.reverse_wrap_extended, true);
for ("ABCDE") |c| try t.print(c);
t.carriageReturn();
try t.linefeed();
try t.print('1');
t.cursorLeft(1 + t.cols + 1);
try t.print('X');
{
var str = try t.plainString(testing.allocator);
defer testing.allocator.free(str);
try testing.expectEqualStrings("ABCDE\n1\n X", str);
}
}