File: atime_test.go

package info (click to toggle)
golang-github-anacrolix-missinggo 2.1.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 836 kB
  • sloc: makefile: 4
file content (27 lines) | stat: -rw-r--r-- 470 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package missinggo

import (
	"io/ioutil"
	"os"
	"testing"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)

func TestFileInfoAccessTime(t *testing.T) {
	f, err := ioutil.TempFile("", "")
	require.NoError(t, err)
	assert.NoError(t, f.Close())
	name := f.Name()
	t.Log(name)
	defer func() {
		err := os.Remove(name)
		if err != nil {
			t.Log(err)
		}
	}()
	fi, err := os.Stat(name)
	require.NoError(t, err)
	t.Log(FileInfoAccessTime(fi))
}