This removes WithWorkDirFS and any other attempts to resolve the current directory (".") in host functions. This is a reaction to reality of compilers who track this inside wasm (not via host functions). One nice side effect is substantially simpler internal implementation of file-systems.
This also allows experimental.WithFS to block file access via passing nil.
Signed-off-by: Adrian Cole <adrian@tetrate.io>
17 lines
377 B
Go
17 lines
377 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/tetratelabs/wazero/internal/testing/maintester"
|
|
"github.com/tetratelabs/wazero/internal/testing/require"
|
|
)
|
|
|
|
// Test_main ensures the following will work:
|
|
//
|
|
// go run cat.go /test.txt
|
|
func Test_main(t *testing.T) {
|
|
stdout, _ := maintester.TestMain(t, main, "cat", "/test.txt")
|
|
require.Equal(t, "greet filesystem\n", stdout)
|
|
}
|