diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-09 23:01:38 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-09 23:01:38 +0200 |
| commit | 227de0db390fec4e1327a7cab6be4c1268848695 (patch) | |
| tree | f70ff9f3b23db47db0e0aeafa1bb1aad5abc71a8 /internal/tui/dashboard/syscalls_test.go | |
| parent | bcaa22111ac619e317f7adfd60a1fc6bd4db8d29 (diff) | |
tui: add reverse sorting for dashboard tables (task 364)
Diffstat (limited to 'internal/tui/dashboard/syscalls_test.go')
| -rw-r--r-- | internal/tui/dashboard/syscalls_test.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/tui/dashboard/syscalls_test.go b/internal/tui/dashboard/syscalls_test.go index 5645aae..2096608 100644 --- a/internal/tui/dashboard/syscalls_test.go +++ b/internal/tui/dashboard/syscalls_test.go @@ -28,7 +28,7 @@ func TestRenderSyscallsIncludesHeaders(t *testing.T) { if !strings.Contains(out, "read") { t.Fatalf("expected syscall row in output") } - if !strings.Contains(out, "s:sort") { + if !strings.Contains(out, "s/S:sort") { t.Fatalf("expected syscall sort hint in output") } if !strings.Contains(out, "sort: default") { @@ -72,6 +72,11 @@ func TestSortedSyscallSnapshotsUsesSelectedSortKey(t *testing.T) { if sorted[0].Name != "read" { t.Fatalf("expected p95 desc sort to put read first, got %q", sorted[0].Name) } + + sorted = sortedSyscallSnapshots(rows, tableSortState[syscallSortKey]{active: true, key: syscallSortKeyName, reverse: true}) + if sorted[0].Name != "write" { + t.Fatalf("expected reverse syscall name sort to put write first, got %q", sorted[0].Name) + } } func TestSyscallSortKeyForColumnKeepsLogicalMeaningAcrossWidths(t *testing.T) { |
