hybridgroup.gobot/system/fs_test.go

23 lines
414 B
Go
Raw Normal View History

2022-11-21 02:22:26 +08:00
package system
2014-11-08 08:21:39 +08:00
import (
"os"
"testing"
"github.com/stretchr/testify/assert"
2014-11-08 08:21:39 +08:00
)
func TestFilesystemOpen(t *testing.T) {
2022-11-05 14:42:28 +08:00
fs := &nativeFilesystem{}
file, err := fs.openFile(os.DevNull, os.O_RDONLY, 0o666)
assert.NoError(t, err)
2014-11-08 08:21:39 +08:00
var _ File = file
}
func TestFilesystemStat(t *testing.T) {
2022-11-05 14:42:28 +08:00
fs := &nativeFilesystem{}
fileInfo, err := fs.stat(os.DevNull)
assert.NoError(t, err)
assert.NotNil(t, fileInfo)
}