mirror of
https://github.com/esengine/DeepSeek-Reasonix.git
synced 2026-11-07 10:45:59 -10:00
Bring in the finished Go rewrite (developed under the placeholder name "duo") as the v2 codebase. Code-only import — no upstream git history. Config- and plugin-driven coding agent: registry core, OpenAI-compatible providers, builtin tools, MCP (stdio + HTTP) plugins, permission + sandbox, custom slash commands, @-references, two-model collaboration. Renamed throughout: duo→reasonix, Duo→Reasonix, DUO→REASONIX — module path, imports, CLI name, cmd/ dirs, reasonix.toml, .reasonix/commands, and $REASONIX_* env prefixes. Kept the v2 MIT LICENSE (the Go project had none). Verified: go build ./... · go vet ./... · go test ./... all green; gofmt clean. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
29 lines
684 B
Go
29 lines
684 B
Go
package cli
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"reasonix/internal/command"
|
|
)
|
|
|
|
func TestChatCommandLookupAndNames(t *testing.T) {
|
|
m := chatTUI{commands: []command.Command{{Name: "review"}, {Name: "git:commit"}}}
|
|
|
|
if _, ok := m.lookupCommand("review"); !ok {
|
|
t.Error("review should be found")
|
|
}
|
|
if _, ok := m.lookupCommand("git:commit"); !ok {
|
|
t.Error("git:commit should be found")
|
|
}
|
|
if _, ok := m.lookupCommand("missing"); ok {
|
|
t.Error("missing should not be found")
|
|
}
|
|
if got := m.commandNames(); got != "/review · /git:commit" {
|
|
t.Errorf("commandNames = %q", got)
|
|
}
|
|
|
|
if got := (&chatTUI{}).commandNames(); got != "" {
|
|
t.Errorf("empty commandNames = %q, want \"\"", got)
|
|
}
|
|
}
|