跳到主要内容

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

浏览文件

mobile_cli_adopt_test.go

18 行 · 814 B历史下载
1package workbench
2
3import "testing"
4
5func TestAdoptedMobileTurns(t *testing.T) {
6 legacy := []mobileTurn{{ID: "failed", Prompt: "failed first", Status: "failed", Error: "not started"},
7 {ID: "mobile", Prompt: "hello", Text: "old partial", Status: "completed"}}
8 current := []mobileTurn{{ID: "cli", Prompt: "hello", Text: "complete", Status: "completed"},
9 {ID: "new", Prompt: "next", Status: "running"}}
10 got := adoptedMobileTurns(legacy, current)
11 if len(got) != 3 || got[0].ID != "failed" || got[1].ID != "mobile" || got[1].Text != "complete" || got[2].ID != "new" {
12 t.Fatalf("history or request identity lost: %#v", got)
13 }
14 // A channel preparing its first frame must not erase cached history.
15 if got := adoptedMobileTurns(legacy, nil); len(got) != 2 || got[1].Text != "old partial" {
16 t.Fatal(got)
17 }
18}