跳到主要内容

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

浏览文件

windows_storage_script_test.go

32 行 · 834 B历史下载
1package guestos
2
3import (
4 "os/exec"
5 "path/filepath"
6 "runtime"
7 "testing"
8)
9
10func TestWindowsStoragePowerShellTransition(t *testing.T) {
11 command := "pwsh"
12 if runtime.GOOS == "windows" {
13 command = "powershell.exe"
14 }
15 powershell, err := exec.LookPath(command)
16 if err != nil {
17 t.Skip("requires PowerShell for the native storage command contract")
18 }
19 source, err := filepath.Abs("windows_storage.ps1")
20 if err != nil {
21 t.Fatal(err)
22 }
23 test, err := filepath.Abs(filepath.Join("testdata", "windows_storage.ps1"))
24 if err != nil {
25 t.Fatal(err)
26 }
27 output, err := exec.Command(powershell, "-NoLogo", "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-File", test, "-Implementation", source).CombinedOutput()
28 if err != nil {
29 t.Fatalf("native storage contract: %v\n%s", err, output)
30 }
31 t.Log(string(output))
32}