mirror of
https://gh-proxy.org/https://github.com/klinsmaya/multica.git
synced 2026-11-10 10:26:46 +08:00
* 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]>
32 lines
987 B
Go
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)
|
|
}
|
|
}
|