Add tests for getCursorGlyph() helper function

pull/7897/head
ClearAspect 2025-07-10 01:48:44 -04:00
parent 88736a2ddb
commit 36a3a3ffa4
No known key found for this signature in database
GPG Key ID: 49E644A14A3E533C
1 changed files with 3 additions and 0 deletions

View File

@ -361,14 +361,17 @@ test Contents {
};
c.setCursor(cursor_cell, .block);
try testing.expectEqual(cursor_cell, c.fg_rows.lists[0].items[0]);
try testing.expectEqual(cursor_cell, c.getCursorGlyph().?);
// And remove it.
c.setCursor(null, null);
try testing.expectEqual(0, c.fg_rows.lists[0].items.len);
try testing.expect(c.getCursorGlyph() == null);
// Add a hollow cursor.
c.setCursor(cursor_cell, .block_hollow);
try testing.expectEqual(cursor_cell, c.fg_rows.lists[rows + 1].items[0]);
try testing.expectEqual(cursor_cell, c.getCursorGlyph().?);
}
test "Contents clear retains other content" {