summaryrefslogtreecommitdiff
path: root/internal/askcli/command_dep_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-23 08:21:27 +0200
committerPaul Buetow <paul@buetow.org>2026-03-23 08:21:27 +0200
commit1e2e96f92d6fb25ae55303d90444534369bda0aa (patch)
treec809ee89978c6de886f66541807d3efc447ac180 /internal/askcli/command_dep_test.go
parent4958ea5100ebf8d4ff9fd818b7bc59d01989feb4 (diff)
fix: correct taskwarrior filter ordering in dep and info commands
- command_dep.go handleDepAddRm: was passing uuid as a modification argument (task modify <uuid> depends:...) which could modify ALL agent tasks; now uses uuid:<uuid> as filter - command_dep.go handleDepList: updated deprecated 'uuid <value>' space syntax to canonical 'uuid:<uuid>' colon syntax - command_info_add.go handleInfo: same space→colon fix for consistency All mutation commands now uniformly use uuid:<uuid> as the filter before the action verb. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/askcli/command_dep_test.go')
-rw-r--r--internal/askcli/command_dep_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/askcli/command_dep_test.go b/internal/askcli/command_dep_test.go
index 26ddf08..b059dd8 100644
--- a/internal/askcli/command_dep_test.go
+++ b/internal/askcli/command_dep_test.go
@@ -9,7 +9,9 @@ import (
)
func TestHandleDep_AddSuccess(t *testing.T) {
+ var capturedArgs []string
d := NewDispatcher(&spyRunner{runFn: func(ctx context.Context, args []string, stdin io.Reader, stdout, stderr io.Writer) (int, error) {
+ capturedArgs = args
return 0, nil
}})
var stdout, stderr bytes.Buffer
@@ -20,6 +22,10 @@ func TestHandleDep_AddSuccess(t *testing.T) {
if !strings.Contains(stdout.String(), "ok") || !strings.Contains(stdout.String(), "uuid-1") {
t.Fatalf("stdout = %q, want ok + uuid", stdout.String())
}
+ // Verify uuid:<uuid> is the filter (not a modification argument).
+ if len(capturedArgs) < 3 || capturedArgs[0] != "uuid:uuid-1" || capturedArgs[1] != "modify" {
+ t.Fatalf("capturedArgs = %v, want [uuid:uuid-1, modify, depends:uuid-2]", capturedArgs)
+ }
}
func TestHandleDep_RmSuccess(t *testing.T) {