跳到主要内容

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

浏览文件

windows_test.go

28 行 · 851 B历史下载
1package env
2
3import (
4 "os"
5 "testing"
6
7 "github.com/sylvinus/agent-vm/internal/paths"
8)
9
10// A project file reached through a link, on Windows, on any host:
11// paths.Windows on and, from a temporary folder, C:/... a relative path.
12// The walk starts at the drive.
13func TestProjectRelWindows(t *testing.T) {
14 old := paths.Windows
15 paths.Windows = func() bool { return true }
16 t.Cleanup(func() { paths.Windows = old })
17 t.Chdir(t.TempDir())
18 os.MkdirAll("C:/p", 0o755)
19 os.Symlink("p", "C:/link")
20 for target, want := range map[string]string{"C:/p/.env": ".env", "C:/link/.env": ".env", "C:/link/sub/x": "sub/x"} {
21 if rel, ok := ProjectRel("C:/p", target); !ok || rel != want {
22 t.Errorf("ProjectRel(C:/p, %q) = %q, %v", target, rel, ok)
23 }
24 }
25 if _, ok := ProjectRel("C:/p", "C:/other/.env"); ok {
26 t.Error("C:/other is not in the project")
27 }
28}