Skip to content

Commit

Permalink
Fix failing test on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Takaya Saeki <[email protected]>
  • Loading branch information
nullpo-head committed Mar 16, 2022
1 parent e9639c5 commit ad2dc8a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func main() {
mod, _ := wazero.StartWASICommandFromSource(r, source)
defer mod.Close()

// "file system!\n", the contents of input.txt, is copied to output.txt.
// "file system!", the contents of input.txt, is copied to output.txt.
output, _ := fs.ReadFile(memFS, "output.txt")
fmt.Println(string(output))
}
Expand Down
2 changes: 1 addition & 1 deletion examples/file_system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ func Test_file_system(t *testing.T) {
// So, the result "output.txt" should contain "Hello, file system!\n".
out, err := fs.ReadFile(memFS, "output.txt")
require.NoError(t, err)
require.Equal(t, "Hello, file system!\n", string(out))

This comment has been minimized.

Copy link
@codefromthecrypt

codefromthecrypt Mar 16, 2022

Contributor

or you can do strings.Trim(string(out) which allows the source to keep its linefeed if you want

require.Equal(t, "Hello, file system!", string(out))
}
2 changes: 1 addition & 1 deletion examples/testdata/file_system_input/input.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
file system!
file system!

0 comments on commit ad2dc8a

Please sign in to comment.