diff options
Diffstat (limited to 'menubar/main.swift')
| -rw-r--r-- | menubar/main.swift | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/menubar/main.swift b/menubar/main.swift index 0d367b8..17b9fcc 100644 --- a/menubar/main.swift +++ b/menubar/main.swift @@ -388,6 +388,15 @@ if arguments.contains("--selftest") { if Hotkey.parse("cmd+shift+f12")?.display != "⇧⌘F12" { failures.append("hotkey: parse cmd+shift+f12") } if Hotkey.parse(Settings().jumpHotkey)?.display != "⌃⌥⌘U" { failures.append("hotkey: default jump is ⌃⌥⌘U") } if Hotkey.parse(Settings().searchHotkey)?.display != "⌃⌥⇧⌘U" { failures.append("hotkey: default search is ⌃⌥⇧⌘U") } + let order: [(String, Status, Int)] = [ + ("idle old", .idle, 10), ("done new", .done, 90), ("idle unknown", .idle, Int.max), + ("working old", .working, 20), ("idle new", .idle, 80), ("done old", .done, 30), + ("blocked", .blocked, 99), ("working new", .working, 70), + ] + let listed = order.map { Row(paneId: $0.0, agent: "pi", name: $0.0, status: $0.1, session: "s", window: "w", + since: $0.2, path: "~") }.sorted(by: listedBefore).map(\.name) + let expected = ["blocked", "done old", "done new", "working new", "working old", "idle new", "idle old", "idle unknown"] + if listed != expected { failures.append("order: waiting oldest first, the rest most recent first: \(listed)") } failures.forEach { print("FAIL \($0)") } print(failures.isEmpty ? "selftest ok" : "selftest: \(failures.count) failed") exit(failures.isEmpty ? 0 : 1) |
