adds experimental sys.Errno to begin decoupling from the syscall package (#1582)

Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
Crypt Keeper
2023-07-17 08:13:29 +08:00
committed by GitHub
parent 1dafce0b2a
commit 2f8dd23097
94 changed files with 1591 additions and 1374 deletions

View File

@@ -9,6 +9,7 @@ import (
"syscall"
"testing"
"github.com/tetratelabs/wazero/experimental/sys"
"github.com/tetratelabs/wazero/internal/fsapi"
"github.com/tetratelabs/wazero/internal/fstest"
"github.com/tetratelabs/wazero/internal/sysfs"
@@ -72,7 +73,7 @@ func TestFSFileReaddir(t *testing.T) {
t.Run("closed dir", func(t *testing.T) {
require.EqualErrno(t, 0, dotF.Close())
_, errno := dotF.Readdir(-1)
require.EqualErrno(t, syscall.EBADF, errno)
require.EqualErrno(t, sys.EBADF, errno)
})
fileF, errno := sysfs.OpenFSFile(tc.fs, "empty.txt", syscall.O_RDONLY, 0)
@@ -81,7 +82,7 @@ func TestFSFileReaddir(t *testing.T) {
t.Run("file", func(t *testing.T) {
_, errno := fileF.Readdir(-1)
require.EqualErrno(t, syscall.EBADF, errno)
require.EqualErrno(t, sys.EBADF, errno)
})
dirF, errno := sysfs.OpenFSFile(tc.fs, "dir", syscall.O_RDONLY, 0)