MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / TestResolve_opencode

Function TestResolve_opencode

internal/agent/resolve_test.go:110–137  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

108}
109
110func TestResolve_opencode(t *testing.T) {
111 // Test OpenCode provider resolution
112 got := mustResolve(t, "opencode", "", nil)
113 if got.Name() != "OpenCode" {
114 t.Errorf("Resolve(opencode) name = %q, want OpenCode", got.Name())
115 }
116 if got.CLIPath() != "opencode" {
117 t.Errorf("Resolve(opencode) CLIPath = %q, want opencode", got.CLIPath())
118 }
119
120 // Test OpenCode with custom path
121 got = mustResolve(t, "opencode", "/usr/local/bin/opencode", nil)
122 if got.CLIPath() != "/usr/local/bin/opencode" {
123 t.Errorf("Resolve(opencode, /usr/local/bin/opencode) CLIPath = %q, want /usr/local/bin/opencode", got.CLIPath())
124 }
125
126 // Test from config
127 cfg := &config.Config{}
128 cfg.Agent.Provider = "opencode"
129 cfg.Agent.CLIPath = "/opt/opencode"
130 got = mustResolve(t, "", "", cfg)
131 if got.Name() != "OpenCode" {
132 t.Errorf("Resolve(_, _, config opencode) name = %q, want OpenCode", got.Name())
133 }
134 if got.CLIPath() != "/opt/opencode" {
135 t.Errorf("Resolve(_, _, config opencode) CLIPath = %q, want /opt/opencode", got.CLIPath())
136 }
137}
138
139func TestResolve_cursor(t *testing.T) {
140 got := mustResolve(t, "cursor", "", nil)

Callers

nothing calls this directly

Calls 3

mustResolveFunction · 0.85
NameMethod · 0.65
CLIPathMethod · 0.65

Tested by

no test coverage detected