diff options
Diffstat (limited to 'menubar/main.swift')
| -rw-r--r-- | menubar/main.swift | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/menubar/main.swift b/menubar/main.swift index 17b9fcc..c37386e 100644 --- a/menubar/main.swift +++ b/menubar/main.swift @@ -397,6 +397,21 @@ if arguments.contains("--selftest") { 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)") } + let byImportance: [(String, Status, Importance, Int)] = [ + ("done old", .done, .normal, 10), ("done new high", .done, .high, 90), ("done older low", .done, .low, 5), + ("blocked low", .blocked, .low, 99), ("working high", .working, .high, 1), ("working new", .working, .normal, 80), + ] + let importanceListed = byImportance.map { Row(paneId: $0.0, agent: "pi", name: $0.0, status: $0.1, session: "s", + window: "w", since: $0.3, path: "~", importance: $0.2) } + .sorted(by: listedBefore).map(\.name) + let importanceExpected = ["blocked low", "done new high", "done old", "done older low", "working high", "working new"] + if importanceListed != importanceExpected { + failures.append("order: status first, then importance, then time: \(importanceListed)") + } + let high = Row(paneId: "%1", agent: "pi", name: "Fix it", status: .done, session: "s", window: "w", since: 1, importance: .high) + if rowTitle(high).string != "✓ ! Fix it" || rowTitlePrefix(high) != "✓ ! " { + failures.append("title: a high agent is marked: \(rowTitle(high).string)") + } failures.forEach { print("FAIL \($0)") } print(failures.isEmpty ? "selftest ok" : "selftest: \(failures.count) failed") exit(failures.isEmpty ? 0 : 1) @@ -405,7 +420,7 @@ if arguments.contains("--print") { let rows = fetchRows() print("title: \(plainTitle(for: rows))") for row in rows { - print("\(row.status.symbol) \(row.status.rawValue)\t\(row.label)\t\(row.subtitle)") + print("\(row.status.symbol) \(row.status.rawValue)\t\(row.markedLabel)\t\(row.subtitle)") } exit(0) } |
