跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

cli_connect_test.go

22 行 · 1.3 KB历史下载
1package workbench
2
3import "testing"
4
5func TestCLIStartupDialogs(t *testing.T) {
6 for _, tc := range []struct{ text, want string }{
7 {"\x1b[31mWARNING: Loading development channels\x1b[0m\r\nChannels: server:cage\r\nI am using this for local development", "channel"},
8 {"Quick safety check: is this a project you created or one you trust?\r\n/work/project\r\nYes, I trust this folder", "project"},
9 {"Quick safety check: is this a project you created or one you trust? /other/project Yes, I trust this folder", ""},
10 {"WARNING: Loading development channels Channels: server:other I am using this for local development", ""},
11 {"WARNING: Loading development channels Channels: server:cage-extra 1. I am using this for local development", ""},
12 {"WARNING: Loading development channels Channels: server:cage,server:other 1. I am using this for local development", ""},
13 {"WARNING: Loading development channels Channels: server:cage ❯ 1. I am using this for local development", "channel"},
14 {"Do you want to proceed? 1. Yes 2. No", ""},
15 {"New MCP server found in this project: other Use this MCP server", ""},
16 {"Do you want to use this API key?", ""},
17 } {
18 if got := cliStartupDialog(cliStartupText([]byte(tc.text)), "/work/project"); got != tc.want {
19 t.Errorf("dialog %q: %q, want %q", tc.text, got, tc.want)
20 }
21 }
22}