wa-lang.org/wazero@v1.0.2/internal/gojs/syscall_test.go (about)

     1  package gojs_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"wa-lang.org/wazero"
     7  	"wa-lang.org/wazero/internal/testing/require"
     8  )
     9  
    10  func Test_syscall(t *testing.T) {
    11  	t.Parallel()
    12  
    13  	stdout, stderr, err := compileAndRun(testCtx, "syscall", wazero.NewModuleConfig())
    14  
    15  	require.EqualError(t, err, `module "" closed with exit_code(0)`)
    16  	require.Zero(t, stderr)
    17  	require.Equal(t, `syscall.Getpid()=1
    18  syscall.Getppid()=0
    19  syscall.Getuid()=0
    20  syscall.Getgid()=0
    21  syscall.Geteuid()=0
    22  syscall.Umask(0077)=0o77
    23  syscall.Getgroups()=[0]
    24  os.FindProcess(pid)=&{1 0 0 {{0 0} 0 0 0 0}}
    25  `, stdout)
    26  }