2022-11-21 02:22:26 +08:00
|
|
|
package system
|
2014-11-08 08:21:39 +08:00
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
2014-12-31 22:12:25 +08:00
|
|
|
|
2023-05-20 20:25:21 +08:00
|
|
|
"gobot.io/x/gobot/v2/gobottest"
|
2014-11-08 08:21:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestFilesystemOpen(t *testing.T) {
|
2022-11-05 14:42:28 +08:00
|
|
|
fs := &nativeFilesystem{}
|
2023-05-19 20:16:22 +08:00
|
|
|
file, err := fs.openFile(os.DevNull, os.O_RDONLY, 0666)
|
2016-02-22 13:21:24 +08:00
|
|
|
gobottest.Assert(t, err, nil)
|
2014-11-08 08:21:39 +08:00
|
|
|
var _ File = file
|
|
|
|
}
|
2017-04-09 17:04:41 +08:00
|
|
|
|
|
|
|
func TestFilesystemStat(t *testing.T) {
|
2022-11-05 14:42:28 +08:00
|
|
|
fs := &nativeFilesystem{}
|
|
|
|
fileInfo, err := fs.stat(os.DevNull)
|
2017-04-09 17:04:41 +08:00
|
|
|
gobottest.Assert(t, err, nil)
|
|
|
|
gobottest.Refute(t, fileInfo, nil)
|
|
|
|
}
|