跳到主要内容

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

浏览文件

machineid_test.go

44 行 · 1.3 KB历史下载
1// SPDX-FileCopyrightText: Copyright The Lima Authors
2// SPDX-License-Identifier: Apache-2.0
3
4package osutil
5
6import (
7 "strings"
8 "testing"
9
10 "gotest.tools/v3/assert"
11)
12
13func TestMachineID(t *testing.T) {
14 t.Log(MachineID())
15}
16
17func TestParseIOPlatformUUIDFromIOPlatformExpertDevice(t *testing.T) {
18 ioPlatformExpertDevice := `
19<?xml version="1.0" encoding="UTF-8"?>
20<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
21<plist version="1.0">
22<dict>
23 <key>IOObjectClass</key>
24 <string>IORegistryEntry</string>
25 <key>IORegistryEntryChildren</key>
26 <array>
27 <dict>
28 <key>foo</key>
29 <string>foo value</string>
30 <key>IOPlatformUUID</key>
31 <string>1A008DA1-06E0-49AB-8EC9-88E9C85F67FB</string>
32 <key>bar</key>
33 <string>bar value</string>
34 </dict>
35 </array>
36 <key>IORegistryEntryName</key>
37 <string>Root</string>
38</dict>
39</plist>
40`
41 got, err := parseIOPlatformUUIDFromIOPlatformExpertDevice(strings.NewReader(ioPlatformExpertDevice))
42 assert.NilError(t, err)
43 assert.Equal(t, "1A008DA1-06E0-49AB-8EC9-88E9C85F67FB", got)
44}