Files
multica/server/pkg/agent/qwen_invocation_test.go
603519d158 MUL-6977: test: remove implementation-only coverage (#7932)
* test: remove implementation-only coverage

Co-authored-by: multica-agent <[email protected]>

* test: remove remaining implementation-only coverage

Co-authored-by: multica-agent <[email protected]>

* test: restore compatibility and fragment navigation coverage

Co-authored-by: multica-agent <[email protected]>

* test: preserve behavioral cleanup contracts

Co-authored-by: multica-agent <[email protected]>

---------

Co-authored-by: Sol-Boy <[email protected]>
Co-authored-by: multica-agent <[email protected]>
2026-09-03 13:23:25 +08:00

32 lines
987 B
Go

package agent
import (
"io"
"log/slog"
"path/filepath"
"reflect"
"testing"
)
// TestChooseQwenInvocation_PassthroughForNonLauncher verifies that when the
// resolved executable is not a Windows .cmd/.bat launcher, both argv[0] and
// the argv list are returned unchanged on every platform. This guards against
// accidental rewriting on macOS/Linux and for direct binary launches on
// Windows.
func TestChooseQwenInvocation_PassthroughForNonLauncher(t *testing.T) {
logger := slog.New(slog.NewTextHandler(io.Discard, nil))
execName := "qwen"
lookedUp := filepath.Join(t.TempDir(), "qwen") // no .cmd / .bat
args := []string{"--output-format", "stream-json", "--yolo"}
gotExec, gotArgs := chooseQwenInvocation(execName, lookedUp, args, logger)
if gotExec != execName {
t.Errorf("argv0 changed unexpectedly: got %q want %q", gotExec, execName)
}
if !reflect.DeepEqual(gotArgs, args) {
t.Errorf("argv changed unexpectedly:\n got %#v\n want %#v", gotArgs, args)
}
}