跳到主要内容

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

浏览文件

licenses_test.go

41 行 · 1.3 KB历史下载
1package cli
2
3import (
4 "strings"
5 "testing"
6
7 agentvm "github.com/sylvinus/agent-vm"
8 "github.com/sylvinus/agent-vm/internal/vm/vmtest"
9)
10
11func TestLicenses(t *testing.T) {
12 te := newTestEnv(t, vmtest.New())
13 if code := te.run("licenses"); code != 0 || te.stderr.Len() != 0 {
14 t.Fatalf("licenses: %d\n%s", code, te.out())
15 }
16 out := te.stdout.String()
17 // agent-vm's own license, the notice, and each project built into the
18 // binary: Apache-2.0 (with Lima's NOTICE), BSD-2 and BSD-3 ones.
19 for _, want := range []string{
20 "MIT License", "Copyright (c) 2026 Sylvain Zimmer",
21 agentvm.Notice,
22 "github.com/lima-vm/lima/v2 ./third_party/lima: LICENSE",
23 "github.com/lima-vm/lima/v2 ./third_party/lima: NOTICE",
24 "github.com/lima-vm/sshocker ./third_party/sshocker: LICENSE",
25 "github.com/containers/gvisor-tap-vsock ./third_party/gvisor-tap-vsock: LICENSE",
26 "github.com/pkg/sftp ./third_party/sftp: LICENSE",
27 "golang.org/x/sys ",
28 "Go standard library",
29 "Apache License",
30 } {
31 if !strings.Contains(out, want) {
32 t.Errorf("the output lacks %q", want)
33 }
34 }
35 if te.run("licenses", "x") != 2 || !strings.Contains(te.out(), "Usage: agent-vm licenses") {
36 t.Errorf("an argument: %s", te.out())
37 }
38 if te.run("--readonly", "licenses") != exitUsage {
39 t.Errorf("a VM option: %s", te.out())
40 }
41}