From 27eb6353030953e91a45b0104bd0567e53622090 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Wed, 16 Sep 2026 09:28:32 +0200 Subject: gui: row menu for trash or permanent delete; Apply frees the directory --- gui/internal/model/plan_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'gui/internal/model/plan_test.go') diff --git a/gui/internal/model/plan_test.go b/gui/internal/model/plan_test.go index 8b7e32f..bf8f19f 100644 --- a/gui/internal/model/plan_test.go +++ b/gui/internal/model/plan_test.go @@ -212,6 +212,25 @@ func TestPlanHoldsTheLock(t *testing.T) { } } +// TestApplyReleasesTheLock: once a plan has been applied it is history, so +// the directory is free again without closing the window (GUI design ยง3). +func TestApplyReleasesTheLock(t *testing.T) { + conf := "(path \"~/dl\")\n(rule \"all\" (move \"Out\"))\n" + e, _ := sandboxDir(t, conf, map[string]string{"a.pdf": "one"}) + tab, _ := planTab(t, e) + if _, err := tab.Apply(context.Background()); err != nil { + t.Fatal(err) + } + l, err := lock.Acquire(context.Background(), e.Config.LockFile("dl"), false) + if err != nil { + t.Fatalf("applying did not release the lock: %v", err) + } + l.Release() + if err := tab.Close(); err != nil { + t.Errorf("closing an applied tab: %v", err) + } +} + // TestPlanRefusesAHeldDirectory: a directory another krino is working in is // not planned at all, and the message names it. func TestPlanRefusesAHeldDirectory(t *testing.T) { -- cgit v1.3