tstor/fs/fs_test.go

25 lines
413 B
Go
Raw Normal View History

2021-11-23 12:05:49 +00:00
package fs
import (
"io/fs"
"testing"
"github.com/stretchr/testify/require"
)
func TestFileinfo(t *testing.T) {
t.Parallel()
require := require.New(t)
fi := NewFileInfo("name", 42, false)
require.Equal(fi.IsDir(), false)
require.Equal(fi.Name(), "name")
require.Equal(fi.Size(), int64(42))
require.NotNil(fi.ModTime())
require.Equal(fi.Mode(), fs.FileMode(0555))
require.Equal(fi.Sys(), nil)
}