跳到主要内容

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

浏览文件

yq.bats

54 行 · 1.5 KB历史下载
1# SPDX-FileCopyrightText: Copyright The Lima Authors
2# SPDX-License-Identifier: Apache-2.0
3
4load "../helpers/load"
5
6@test 'make sure the yq subcommand exists' {
7 run -0 limactl yq --version
8 assert_output --regexp '^yq .*mikefarah.* version v'
9}
10
11@test 'yq can evaluate yq expressions' {
12 run -0 limactl yq -n .foo=42
13 assert_output 'foo: 42'
14}
15
16@test 'yq command understand yq options' {
17 run -0 limactl yq -n -o json -I 0 .foo=42
18 assert_output '{"foo":42}'
19}
20
21@test 'yq errors set non-zero exit code' {
22 run -1 limactl yq -n foo
23 assert_output --partial "invalid input"
24}
25
26@test 'yq works as a multi-call binary' {
27 # multi-call command detection strips all extensions
28 YQ="yq.lima.exe"
29 ln -sf "$(which limactl)" "${BATS_TEST_TMPDIR}/${YQ}"
30 export PATH="$BATS_TEST_TMPDIR:$PATH"
31
32 run -0 "$YQ" --version
33 assert_output --regexp '^yq .*mikefarah.* version v'
34
35 run -0 "$YQ" -n -o json -I 0 .foo=42
36 assert_output '{"foo":42}'
37}
38
39@test 'yq multi-call command has support for env access' {
40 export FOO=bar
41 run -0 limactl yq -n 'env(FOO)'
42 assert_output "bar"
43}
44
45@test 'yq multi-call command has support for --security-disable-env-ops' {
46 export FOO=bar
47 run_e -1 limactl yq -n --security-disable-env-ops 'env(FOO)'
48 assert_stderr "Error: env operations have been disabled"
49}
50
51@test 'yq multi-call command has system operations disabled by default' {
52 run -1 limactl yq -n 'system("echo hello")'
53 assert_output --partial "system operations are disabled"
54}