fix: review findings for lazysecrets list: recent means the last 90 days, cache saves lock and keep deletions and the TUI's cursors, failed lists aren't retried, one expiry rule
This commit is contained in:
23 files changed
+333
-107
No files matched your search
@@ -119,3 +119,15 @@ func TestStarsPerAccount(t *testing.T) {
|
||||
t.Errorf("unstar alice: %v", n.StarredBy)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUsedLately(t *testing.T) {
|
||||
now := time.Now()
|
||||
for ago, want := range map[time.Duration]bool{time.Hour: true, 89 * 24 * time.Hour: true, 2 * 365 * 24 * time.Hour: false} {
|
||||
if got := (Node{LastUsed: now.Add(-ago)}).UsedLately(now); got != want {
|
||||
t.Errorf("used %v ago: %v", ago, got)
|
||||
}
|
||||
}
|
||||
if (Node{}).UsedLately(now) {
|
||||
t.Error("never used is lately")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user