Sneaked in a few last minute bug fixes for table mode.

This commit is contained in:
Storm Dragon committed 2026-10-30 18:56:58 -04:00
1 parent 2c893dccb9
commit a27f274099
12 files changed
+747 -25

No files matched your search

+27
View File
@@ -81,6 +81,33 @@ func TestTrackingCycleDefaultsAndReview(t *testing.T) {
}
}
func TestTableHeadersAfterCommandOutputAndExplicitClear(t *testing.T) {
r := New()
r.Update(fixture("$ free -h", "", "", "", ""))
r.Configure_tracking("table")
next := fixture("$ free -h", " total used", "Mem: 12 3", "Swap: 4 0", "$ ")
next.Y = 4
if output := r.Update(next); len(output) == 0 || r.review.Active() {
t.Fatal("table placement suppressed automatic output or entered review early", output)
}
if got := r.Command(command.CurrentWord).Text; got != "Mem: Column 1" {
t.Fatal("review did not start at first data cell", got)
}
if got := r.Command(command.NextWord).Text; got != "12 total" {
t.Fatal("command output headers were not available through reader dispatch", got)
}
r.Clear_marks()
if got := r.Command(command.CurrentWord).Text; got != "12 Column 2" {
t.Fatal("reader clear did not clear headers", got)
}
r.Command(command.PreviousLine)
r.Set_mark()
r.Command(command.NextLine)
if got := r.Command(command.CurrentWord).Text; got != "12 total" {
t.Fatal("manual selection after clear failed through reader dispatch", got)
}
}
func TestHighlightSelectionAndSuppression(t *testing.T) {
selected := screen.Attribute{Foreground: 7, Background: 4}
base := fixture("First message", "Second message", "Third message", "status")