Add tests for getCursorGlyph() helper function

This commit is contained in:
ClearAspect
2025-07-10 01:48:44 -04:00
parent 88736a2ddb
commit 36a3a3ffa4

View File

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