2022-11-20 19:22:26 +01:00
|
|
|
package system
|
2014-11-07 16:21:39 -08:00
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
2014-12-31 06:12:25 -08:00
|
|
|
|
2023-10-20 10:27:09 +02:00
|
|
|
"github.com/stretchr/testify/assert"
|
2023-11-12 14:17:02 +01:00
|
|
|
"github.com/stretchr/testify/require"
|
2014-11-07 16:21:39 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestFilesystemOpen(t *testing.T) {
|
2022-11-05 07:42:28 +01:00
|
|
|
fs := &nativeFilesystem{}
|
2023-10-20 20:50:42 +02:00
|
|
|
file, err := fs.openFile(os.DevNull, os.O_RDONLY, 0o666)
|
2023-11-12 14:17:02 +01:00
|
|
|
require.NoError(t, err)
|
2014-11-07 16:21:39 -08:00
|
|
|
var _ File = file
|
|
|
|
}
|
2017-04-09 11:04:41 +02:00
|
|
|
|
|
|
|
func TestFilesystemStat(t *testing.T) {
|
2022-11-05 07:42:28 +01:00
|
|
|
fs := &nativeFilesystem{}
|
|
|
|
fileInfo, err := fs.stat(os.DevNull)
|
2023-11-12 14:17:02 +01:00
|
|
|
require.NoError(t, err)
|
2023-10-20 10:27:09 +02:00
|
|
|
assert.NotNil(t, fileInfo)
|
2017-04-09 11:04:41 +02:00
|
|
|
}
|