summaryrefslogtreecommitdiff
path: root/internal/askcli/taskexec_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-08 09:58:02 +0300
committerPaul Buetow <paul@buetow.org>2026-04-08 09:58:02 +0300
commit8e351c86502cea78f1f0b3aa19cde7ca702bacab (patch)
tree1340e27219255b0ebe49bdbe3b5c2fbd95df8810 /internal/askcli/taskexec_test.go
parent9e8f558a1f6fcdb09a8a02dfcd2e3d8fc9ce613f (diff)
Rename task CLI from ask to do
- Move cmd/ask to cmd/do; mage BuildDo builds binary named do - Update askcli help text, errors, Fish completion (complete -c do, __do_*) - Task alias cache path: XDG cache hexai/do/task-aliases-v2.json - Refresh README and docs; go install path cmd/do@latest - Remove accidentally tracked cmd/ask build artifact; ignore cmd/do/do and cmd/do/ask Made-with: Cursor
Diffstat (limited to 'internal/askcli/taskexec_test.go')
-rw-r--r--internal/askcli/taskexec_test.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/internal/askcli/taskexec_test.go b/internal/askcli/taskexec_test.go
index 90da61a..4db988b 100644
--- a/internal/askcli/taskexec_test.go
+++ b/internal/askcli/taskexec_test.go
@@ -12,7 +12,7 @@ import (
)
func TestExecutorTaskArgs(t *testing.T) {
- exec_ := NewExecutor("ask")
+ exec_ := NewExecutor("do")
args, err := exec_.taskArgs(context.Background(), "/tmp/work/hexai", []string{"list", "limit:1"})
if err != nil {
t.Fatalf("taskArgs returned error: %v", err)
@@ -24,7 +24,7 @@ func TestExecutorTaskArgs(t *testing.T) {
}
func TestExecutorTaskArgs_NoAgentScope(t *testing.T) {
- exec_ := NewExecutor("ask")
+ exec_ := NewExecutor("do")
ctx := contextWithTaskScope(context.Background(), taskScopeNoAgent)
args, err := exec_.taskArgs(ctx, "/tmp/work/hexai", []string{"list", "limit:1"})
if err != nil {
@@ -37,7 +37,7 @@ func TestExecutorTaskArgs_NoAgentScope(t *testing.T) {
}
func TestExecutorTaskArgs_AddDefaultScope(t *testing.T) {
- exec_ := NewExecutor("ask")
+ exec_ := NewExecutor("do")
args, err := exec_.taskArgs(context.Background(), "/tmp/work/hexai", []string{"add", "rc.verbose=nothing", "rc.verbose=new-uuid", "new task"})
if err != nil {
t.Fatalf("taskArgs returned error: %v", err)
@@ -49,7 +49,7 @@ func TestExecutorTaskArgs_AddDefaultScope(t *testing.T) {
}
func TestExecutorTaskArgs_AddNoAgentScope(t *testing.T) {
- exec_ := NewExecutor("ask")
+ exec_ := NewExecutor("do")
ctx := contextWithTaskScope(context.Background(), taskScopeNoAgent)
args, err := exec_.taskArgs(ctx, "/tmp/work/hexai", []string{"add", "rc.verbose=nothing", "rc.verbose=new-uuid", "new task"})
if err != nil {
@@ -65,7 +65,7 @@ func TestExecutorRun_InjectsProjectFilterAndAgentTag(t *testing.T) {
var gotName string
var gotArgs []string
exec_ := Executor{
- commandName: "ask",
+ commandName: "do",
findBinary: func() (string, error) { return "/usr/bin/task", nil },
detectRepoRoot: func(context.Context) (string, error) { return "/tmp/work/hexai", nil },
runCommand: func(_ context.Context, name string, args []string, stdin io.Reader, stdout, stderr io.Writer) error {
@@ -94,7 +94,7 @@ func TestExecutorRun_InjectsProjectFilterAndAgentTag(t *testing.T) {
func TestExecutorRun_InjectsProjectFilterAndNoAgentTag(t *testing.T) {
var gotArgs []string
exec_ := Executor{
- commandName: "ask",
+ commandName: "do",
findBinary: func() (string, error) { return "/usr/bin/task", nil },
detectRepoRoot: func(context.Context) (string, error) { return "/tmp/work/hexai", nil },
runCommand: func(_ context.Context, name string, args []string, stdin io.Reader, stdout, stderr io.Writer) error {
@@ -119,7 +119,7 @@ func TestExecutorRun_InjectsProjectFilterAndNoAgentTag(t *testing.T) {
func TestExecutorRun_OutsideGitRepo_IsActionable(t *testing.T) {
exec_ := Executor{
- commandName: "ask",
+ commandName: "do",
findBinary: func() (string, error) { return "/usr/bin/task", nil },
detectRepoRoot: func(context.Context) (string, error) { return "", errors.New("git failed") },
runCommand: func(context.Context, string, []string, io.Reader, io.Writer, io.Writer) error {
@@ -139,7 +139,7 @@ func TestExecutorRun_OutsideGitRepo_IsActionable(t *testing.T) {
func TestExecutorRun_PreservesTaskwarriorExitCode(t *testing.T) {
exec_ := Executor{
- commandName: "ask",
+ commandName: "do",
findBinary: func() (string, error) { return "/usr/bin/task", nil },
detectRepoRoot: func(context.Context) (string, error) { return "/tmp/work/hexai", nil },
runCommand: func(context.Context, string, []string, io.Reader, io.Writer, io.Writer) error {
@@ -160,7 +160,7 @@ func TestExecutorRun_PreservesStdoutAndStderr(t *testing.T) {
var stdout bytes.Buffer
var stderr bytes.Buffer
exec_ := Executor{
- commandName: "ask",
+ commandName: "do",
findBinary: func() (string, error) { return "/usr/bin/task", nil },
detectRepoRoot: func(context.Context) (string, error) { return "/tmp/work/hexai", nil },
runCommand: func(_ context.Context, name string, args []string, stdin io.Reader, out, errOut io.Writer) error {
@@ -187,7 +187,7 @@ func TestExecutorRun_PreservesStdoutAndStderr(t *testing.T) {
func TestExecutorRun_TaskLookupFailure_IsActionable(t *testing.T) {
exec_ := Executor{
- commandName: "ask",
+ commandName: "do",
findBinary: func() (string, error) { return "", errors.New("not found") },
}
@@ -202,7 +202,7 @@ func TestExecutorRun_TaskLookupFailure_IsActionable(t *testing.T) {
func TestExecutorRun_EmptyRepoName_IsActionable(t *testing.T) {
exec_ := Executor{
- commandName: "ask",
+ commandName: "do",
findBinary: func() (string, error) { return "/usr/bin/task", nil },
detectRepoRoot: func(context.Context) (string, error) { return "/", nil },
}