跳到主要内容

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

浏览文件

attrs_atime_test.go

26 行 · 632 B历史下载
1//go:build darwin || (!android && linux)
2// +build darwin !android,linux
3
4package sftp
5
6import (
7 "os"
8 "path/filepath"
9 "testing"
10 "time"
11
12 "github.com/stretchr/testify/assert"
13 "github.com/stretchr/testify/require"
14)
15
16func TestFileStatFromInfoAtime(t *testing.T) {
17 f := filepath.Join(t.TempDir(), "f")
18 require.NoError(t, os.WriteFile(f, nil, 0o644))
19 at, mt := time.Unix(1000000000, 0), time.Unix(1500000000, 0)
20 require.NoError(t, os.Chtimes(f, at, mt))
21 fi, err := os.Stat(f)
22 require.NoError(t, err)
23 _, st := fileStatFromInfo(fi)
24 assert.Equal(t, uint32(at.Unix()), st.Atime)
25 assert.Equal(t, uint32(mt.Unix()), st.Mtime)
26}