2014-11-08 08:21:39 +08:00
|
|
|
package sysfs
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
2014-12-31 22:12:25 +08:00
|
|
|
|
2016-12-08 20:24:03 +08:00
|
|
|
"gobot.io/x/gobot/gobottest"
|
2014-11-08 08:21:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestFilesystemOpen(t *testing.T) {
|
|
|
|
SetFilesystem(&NativeFilesystem{})
|
|
|
|
file, err := OpenFile(os.DevNull, os.O_RDONLY, 666)
|
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) {
|
|
|
|
SetFilesystem(&NativeFilesystem{})
|
|
|
|
fileInfo, err := Stat(os.DevNull)
|
|
|
|
gobottest.Assert(t, err, nil)
|
|
|
|
gobottest.Refute(t, fileInfo, nil)
|
|
|
|
}
|