Skip to content

Commit 206d418

Browse files
authored
terminal: fix unexpected line wrapping in tests (ghostty-org#7709)
These tests write specific lines into a 10-column-wide test screen. The "prompt3$ input3\n" writes exceed that column limit, and some of their characters wrap onto the following line. These tests' current assertions aren't sensitive to that overflow, but I spotted the problem while doing some related work, and I thought it worth making these corrections to avoid any future surprises.
2 parents 98b1af8 + 138f745 commit 206d418

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/terminal/Screen.zig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7911,7 +7911,7 @@ test "Screen: selectOutput" {
79117911
try s.testWriteString("input2\n"); // 3
79127912
try s.testWriteString("output2output2output2output2\n"); // 4, 5, 6 due to overflow
79137913
try s.testWriteString("output2\n"); // 7
7914-
try s.testWriteString("prompt3$ input3\n"); // 8
7914+
try s.testWriteString("$ input3\n"); // 8
79157915
try s.testWriteString("output3\n"); // 9
79167916
try s.testWriteString("output3\n"); // 10
79177917
try s.testWriteString("output3"); // 11
@@ -7999,14 +7999,14 @@ test "Screen: selectOutput" {
79997999
} }, s.pages.pointFromPin(.active, sel.start()).?);
80008000
try testing.expectEqual(point.Point{ .active = .{
80018001
.x = 9,
8002-
.y = 12,
8002+
.y = 11,
80038003
} }, s.pages.pointFromPin(.active, sel.end()).?);
80048004
}
80058005
// input / prompt at y = 0, pt.y = 0
80068006
{
80078007
s.deinit();
80088008
s = try init(alloc, 10, 5, 0);
8009-
try s.testWriteString("prompt1$ input1\n");
8009+
try s.testWriteString("$ input1\n");
80108010
try s.testWriteString("output1\n");
80118011
try s.testWriteString("prompt2\n");
80128012
{
@@ -8042,7 +8042,7 @@ test "Screen: selectPrompt basics" {
80428042
try s.testWriteString("input2\n"); // 3
80438043
try s.testWriteString("output2\n"); // 4
80448044
try s.testWriteString("output2\n"); // 5
8045-
try s.testWriteString("prompt3$ input3\n"); // 6
8045+
try s.testWriteString("$ input3\n"); // 6
80468046
try s.testWriteString("output3\n"); // 7
80478047
try s.testWriteString("output3\n"); // 8
80488048
try s.testWriteString("output3"); // 9
@@ -8257,7 +8257,7 @@ test "Screen: promptPath" {
82578257
try s.testWriteString("input2\n"); // 3
82588258
try s.testWriteString("output2\n"); // 4
82598259
try s.testWriteString("output2\n"); // 5
8260-
try s.testWriteString("prompt3$ input3\n"); // 6
8260+
try s.testWriteString("$ input3\n"); // 6
82618261
try s.testWriteString("output3\n"); // 7
82628262
try s.testWriteString("output3\n"); // 8
82638263
try s.testWriteString("output3"); // 9

0 commit comments

Comments
 (0)