跳到主要内容

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

浏览文件

strutil_test.go

23 行 · 492 B历史下载
1// SPDX-FileCopyrightText: Copyright The Lima Authors
2// SPDX-License-Identifier: Apache-2.0
3
4package strutil
5
6import (
7 "bytes"
8 "encoding/binary"
9 "testing"
10
11 "gotest.tools/v3/assert"
12)
13
14func TestFromUTF16leToString(t *testing.T) {
15 // "Hi" in UTF-16LE without BOM
16 buf := make([]byte, 4)
17 binary.LittleEndian.PutUint16(buf[0:], 'H')
18 binary.LittleEndian.PutUint16(buf[2:], 'i')
19
20 got, err := FromUTF16leToString(bytes.NewReader(buf))
21 assert.NilError(t, err)
22 assert.Equal(t, got, "Hi")
23}