跳到主要内容

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

浏览文件

features_test.go

36 行 · 1007 B历史下载
1//go:build !windows
2
3// SPDX-FileCopyrightText: Copyright The Lima Authors
4// SPDX-License-Identifier: Apache-2.0
5
6package qemu
7
8import (
9 "context"
10 "os"
11 "path/filepath"
12 "testing"
13
14 "gotest.tools/v3/assert"
15)
16
17// Each help text is its own: the features are searched as text, and a netdev
18// list holding the accelerators' words would match them.
19func TestInspectFeaturesOwnOutputs(t *testing.T) {
20 exe := filepath.Join(t.TempDir(), "qemu-fake")
21 script := `#!/bin/sh
22case "$*" in
23 *-cpu*) echo "cpus: max" ;;
24 *-accel*) echo "accels: tcg" ;;
25 *-netdev*) echo "netdevs: dgram" ;;
26 *-machine*) echo "machines: virt" ;;
27esac
28`
29 assert.NilError(t, os.WriteFile(exe, []byte(script), 0o755))
30 f, err := inspectFeatures(context.Background(), exe, "virt")
31 assert.NilError(t, err)
32 assert.Equal(t, string(f.AccelHelp), "accels: tcg\n")
33 assert.Equal(t, string(f.NetdevHelp), "netdevs: dgram\n")
34 assert.Equal(t, string(f.MachineHelp), "machines: virt\n")
35 assert.Equal(t, string(f.CPUHelp), "cpus: max\n")
36}