summaryrefslogtreecommitdiff
path: root/cmd/hexai/task_command_test.go
blob: 2cdf0bc80cf83ac11776bd7145eba758470a6449 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package main

import (
	"bytes"
	"strings"
	"testing"
)

func TestRunTaskSubcommandIfRequested_SkipsNonTaskArgs(t *testing.T) {
	handled, exitCode, err := runTaskSubcommandIfRequested([]string{"hello"}, strings.NewReader(""), &bytes.Buffer{}, &bytes.Buffer{})
	if handled || exitCode != 0 || err != nil {
		t.Fatalf("expected non-task args to be ignored, got handled=%v exitCode=%d err=%v", handled, exitCode, err)
	}
}