diff --git a/.gitmodules b/.gitmodules index b1be3b2f16..db562cb21a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "deno_third_party"] path = third_party url = https://github.com/denoland/deno_third_party.git +[submodule "std/wasi/testdata"] + path = std/wasi/testdata + url = git@github.com:khronosproject/wasi-test-suite.git diff --git a/std/wasi/snapshot_preview1_test.ts b/std/wasi/snapshot_preview1_test.ts index dce37d220f..aaffb3e20d 100644 --- a/std/wasi/snapshot_preview1_test.ts +++ b/std/wasi/snapshot_preview1_test.ts @@ -1,17 +1,32 @@ /* eslint-disable */ import { assert, assertEquals } from "../testing/asserts.ts"; +import { copy } from "../fs/mod.ts"; import * as path from "../path/mod.ts"; import Context from "./snapshot_preview1.ts"; +const ignore = [ + "wasi_clock_time_get_realtime.wasm", +]; + +// TODO(caspervonb) investigate why these tests are failing on windows and fix +// them. +if (Deno.build.os == "windows") { + ignore.push("std_fs_metadata_absolute.wasm"); + ignore.push("std_fs_metadata_relative.wasm"); + ignore.push("std_fs_read_dir_absolute.wasm"); + ignore.push("std_fs_read_dir_relative.wasm"); +} + if (import.meta.main) { const options = JSON.parse(Deno.args[0]); - const binary = await Deno.readFile(Deno.args[1]); + const pathname = Deno.args[1]; + const binary = await Deno.readFile(pathname); const module = await WebAssembly.compile(binary); const context = new Context({ env: options.env, - args: options.args, + args: [pathname].concat(options.args), preopens: options.preopens, }); @@ -25,115 +40,83 @@ if (import.meta.main) { } else { const rootdir = path.dirname(path.fromFileUrl(import.meta.url)); const testdir = path.join(rootdir, "testdata"); - const outdir = path.join(testdir, "snapshot_preview1"); for await (const entry of Deno.readDir(testdir)) { - if (!entry.name.endsWith(".rs")) { - continue; - } - - const process = Deno.run({ - cmd: [ - "rustc", - "--target", - "wasm32-wasi", - "--out-dir", - outdir, - path.join(testdir, entry.name), - ], - stdout: "inherit", - stderr: "inherit", - }); - - const status = await process.status(); - assert(status.success); - - process.close(); - - // TODO(caspervonb) allow the prelude to span multiple lines - const source = await Deno.readTextFile(path.join(testdir, entry.name)); - const prelude = source.match(/^\/\/\s*\{.*/); - if (prelude) { - const basename = entry.name.replace(/.rs$/, ".json"); - await Deno.writeTextFile( - path.join(outdir, basename), - prelude[0].slice(2), - ); - } - } - - for await (const entry of Deno.readDir(outdir)) { if (!entry.name.endsWith(".wasm")) { continue; } - Deno.test(entry.name, async function () { - const basename = entry.name.replace(/\.wasm$/, ".json"); - const prelude = await Deno.readTextFile(path.resolve(outdir, basename)); - const options = JSON.parse(prelude); + Deno.test({ + name: entry.name, + ignore: ignore.includes(entry.name), + fn: async function () { + const basename = entry.name.replace(/\.wasm$/, ".json"); + const prelude = await Deno.readTextFile( + path.resolve(testdir, basename), + ); + const options = JSON.parse(prelude); - await Deno.mkdir(`${testdir}/scratch`); + const workdir = await Deno.makeTempDir(); + await copy( + path.join(testdir, "fixtures"), + path.join(workdir, "fixtures"), + ); - try { - const process = await Deno.run({ - cwd: testdir, - cmd: [ - `${Deno.execPath()}`, - "run", - "--quiet", - "--unstable", - "--allow-all", - import.meta.url, - prelude, - path.resolve(outdir, entry.name), - ], - stdin: "piped", - stdout: "piped", - stderr: "piped", - }); + try { + const process = await Deno.run({ + cwd: workdir, + cmd: [ + `${Deno.execPath()}`, + "run", + "--quiet", + "--unstable", + "--allow-all", + import.meta.url, + prelude, + path.resolve(testdir, entry.name), + ], + stdin: "piped", + stdout: "piped", + stderr: "piped", + }); - if (options.stdin) { - const stdin = new TextEncoder().encode(options.stdin); - await Deno.writeAll(process.stdin, stdin); - } - - process.stdin.close(); - - const stdout = await Deno.readAll(process.stdout); - - if (options.stdout) { - assertEquals(new TextDecoder().decode(stdout), options.stdout); - } else { - await Deno.writeAll(Deno.stdout, stdout); - } - - process.stdout.close(); - - const stderr = await Deno.readAll(process.stderr); - - if (options.stderr) { - assertEquals(new TextDecoder().decode(stderr), options.stderr); - } else { - await Deno.writeAll(Deno.stderr, stderr); - } - - process.stderr.close(); - - if (options.files) { - for (const [key, value] of Object.entries(options.files)) { - assertEquals(value, await Deno.readTextFile(`${testdir}/${key}`)); + if (options.stdin) { + const stdin = new TextEncoder().encode(options.stdin); + await Deno.writeAll(process.stdin, stdin); } + + process.stdin.close(); + + const stdout = await Deno.readAll(process.stdout); + + if (options.stdout) { + assertEquals(new TextDecoder().decode(stdout), options.stdout); + } else { + await Deno.writeAll(Deno.stdout, stdout); + } + + process.stdout.close(); + + const stderr = await Deno.readAll(process.stderr); + + if (options.stderr) { + assertEquals(new TextDecoder().decode(stderr), options.stderr); + } else { + await Deno.writeAll(Deno.stderr, stderr); + } + + process.stderr.close(); + + const status = await process.status(); + assertEquals(status.code, options.exitCode ? +options.exitCode : 0); + + process.close(); + } catch (err) { + throw err; + } finally { + await Deno.remove(workdir, { recursive: true }); } - - const status = await process.status(); - assertEquals(status.code, options.exitCode ? +options.exitCode : 0); - - process.close(); - } catch (err) { - throw err; - } finally { - await Deno.remove(`${testdir}/scratch`, { recursive: true }); - } + }, }); } } diff --git a/std/wasi/testdata b/std/wasi/testdata new file mode 160000 index 0000000000..419874edc0 --- /dev/null +++ b/std/wasi/testdata @@ -0,0 +1 @@ +Subproject commit 419874edc0dd334df55760ba626ecc94a1df7cc9 diff --git a/std/wasi/testdata/fixture/directory/file b/std/wasi/testdata/fixture/directory/file deleted file mode 100644 index 3c4dadafb3..0000000000 --- a/std/wasi/testdata/fixture/directory/file +++ /dev/null @@ -1 +0,0 @@ -directory/file diff --git a/std/wasi/testdata/fixture/directory/symlink_to_file b/std/wasi/testdata/fixture/directory/symlink_to_file deleted file mode 120000 index 1a010b1c0f..0000000000 --- a/std/wasi/testdata/fixture/directory/symlink_to_file +++ /dev/null @@ -1 +0,0 @@ -file \ No newline at end of file diff --git a/std/wasi/testdata/fixture/file b/std/wasi/testdata/fixture/file deleted file mode 100644 index f73f3093ff..0000000000 --- a/std/wasi/testdata/fixture/file +++ /dev/null @@ -1 +0,0 @@ -file diff --git a/std/wasi/testdata/fixture/symlink_to_directory b/std/wasi/testdata/fixture/symlink_to_directory deleted file mode 120000 index 6d0450cc24..0000000000 --- a/std/wasi/testdata/fixture/symlink_to_directory +++ /dev/null @@ -1 +0,0 @@ -directory \ No newline at end of file diff --git a/std/wasi/testdata/fixture/symlink_to_file b/std/wasi/testdata/fixture/symlink_to_file deleted file mode 120000 index 1a010b1c0f..0000000000 --- a/std/wasi/testdata/fixture/symlink_to_file +++ /dev/null @@ -1 +0,0 @@ -file \ No newline at end of file diff --git a/std/wasi/testdata/std_env_args.rs b/std/wasi/testdata/std_env_args.rs deleted file mode 100644 index f07349c1cc..0000000000 --- a/std/wasi/testdata/std_env_args.rs +++ /dev/null @@ -1,9 +0,0 @@ -// { "args": ["one", "two", "three" ]} - -fn main() { - let mut args = std::env::args(); - assert_eq!(args.len(), 3); - assert_eq!(args.next().unwrap(), "one"); - assert_eq!(args.next().unwrap(), "two"); - assert_eq!(args.next().unwrap(), "three"); -} diff --git a/std/wasi/testdata/std_env_vars.rs b/std/wasi/testdata/std_env_vars.rs deleted file mode 100644 index 5c088a5faf..0000000000 --- a/std/wasi/testdata/std_env_vars.rs +++ /dev/null @@ -1,6 +0,0 @@ -// { "env": { "one": "1", "two": "2", "three": "3" } } - -fn main() { - let vars = std::env::vars(); - assert_eq!(vars.count(), 3); -} diff --git a/std/wasi/testdata/std_fs_create_dir.rs b/std/wasi/testdata/std_fs_create_dir.rs deleted file mode 100644 index 3ea41fd2fd..0000000000 --- a/std/wasi/testdata/std_fs_create_dir.rs +++ /dev/null @@ -1,6 +0,0 @@ -// { "preopens": { "/scratch": "scratch" } } - -fn main() { - assert!(std::fs::create_dir("/scratch/directory").is_ok()); - assert!(std::fs::metadata("/scratch/directory").unwrap().is_dir()); -} diff --git a/std/wasi/testdata/std_fs_file_create.rs b/std/wasi/testdata/std_fs_file_create.rs deleted file mode 100644 index eec1f8350e..0000000000 --- a/std/wasi/testdata/std_fs_file_create.rs +++ /dev/null @@ -1,6 +0,0 @@ -// { "preopens": { "/scratch": "scratch" } } - -fn main() { - assert!(std::fs::File::create("/scratch/file").is_ok()); - assert!(std::fs::metadata("/scratch/file").unwrap().is_file()); -} diff --git a/std/wasi/testdata/std_fs_file_metadata.rs b/std/wasi/testdata/std_fs_file_metadata.rs deleted file mode 100644 index 93149fd1c7..0000000000 --- a/std/wasi/testdata/std_fs_file_metadata.rs +++ /dev/null @@ -1,23 +0,0 @@ -// { "preopens": { "/fixture": "fixture" } } - -fn main() { - let file = std::fs::File::open("/fixture/file").unwrap(); - let metadata = file.metadata().unwrap(); - assert!(metadata.is_file()); - assert!(metadata.len() == 5); - - let file = std::fs::File::open("/fixture/symlink_to_file").unwrap(); - let metadata = file.metadata().unwrap(); - assert!(metadata.is_file()); - assert!(metadata.len() == 5); - - let file = std::fs::File::open("/fixture/directory/file").unwrap(); - let metadata = file.metadata().unwrap(); - assert!(metadata.is_file()); - assert!(metadata.len() == 15); - - let file = std::fs::File::open("/fixture/directory/symlink_to_file").unwrap(); - let metadata = file.metadata().unwrap(); - assert!(metadata.is_file()); - assert!(metadata.len() == 15); -} diff --git a/std/wasi/testdata/std_fs_file_read.rs b/std/wasi/testdata/std_fs_file_read.rs deleted file mode 100644 index 332e008f11..0000000000 --- a/std/wasi/testdata/std_fs_file_read.rs +++ /dev/null @@ -1,16 +0,0 @@ -// { "preopens": { "/fixture": "fixture" } } - -use std::io::Read; - -fn main() { - let mut file = std::fs::File::open("/fixture/file").unwrap(); - let mut buffer = [0; 2]; - - assert_eq!(file.read(&mut buffer).unwrap(), 2); - assert_eq!(&buffer, b"fi"); - - assert_eq!(file.read(&mut buffer).unwrap(), 2); - assert_eq!(&buffer, b"le"); - - assert_eq!(file.read(&mut buffer).unwrap(), 1); -} diff --git a/std/wasi/testdata/std_fs_file_seek.rs b/std/wasi/testdata/std_fs_file_seek.rs deleted file mode 100644 index 1e2a9d7def..0000000000 --- a/std/wasi/testdata/std_fs_file_seek.rs +++ /dev/null @@ -1,33 +0,0 @@ -// { "preopens": { "/fixture": "fixture" } } - -use std::io::Seek; - -fn main() { - let mut file = std::fs::File::open("/fixture/file").unwrap(); - assert_eq!(file.seek(std::io::SeekFrom::Current(0)).unwrap(), 0); - - assert_eq!(file.seek(std::io::SeekFrom::Start(1)).unwrap(), 1); - assert_eq!(file.seek(std::io::SeekFrom::Start(2)).unwrap(), 2); - assert_eq!(file.seek(std::io::SeekFrom::Start(3)).unwrap(), 3); - assert_eq!(file.seek(std::io::SeekFrom::Start(4)).unwrap(), 4); - assert_eq!(file.seek(std::io::SeekFrom::Start(5)).unwrap(), 5); - - assert_eq!(file.seek(std::io::SeekFrom::Current(-1)).unwrap(), 4); - assert_eq!(file.seek(std::io::SeekFrom::Current(-1)).unwrap(), 3); - assert_eq!(file.seek(std::io::SeekFrom::Current(-1)).unwrap(), 2); - assert_eq!(file.seek(std::io::SeekFrom::Current(-1)).unwrap(), 1); - assert_eq!(file.seek(std::io::SeekFrom::Current(-1)).unwrap(), 0); - - assert_eq!(file.seek(std::io::SeekFrom::Current(1)).unwrap(), 1); - assert_eq!(file.seek(std::io::SeekFrom::Current(1)).unwrap(), 2); - assert_eq!(file.seek(std::io::SeekFrom::Current(1)).unwrap(), 3); - assert_eq!(file.seek(std::io::SeekFrom::Current(1)).unwrap(), 4); - assert_eq!(file.seek(std::io::SeekFrom::Current(1)).unwrap(), 5); - - assert_eq!(file.seek(std::io::SeekFrom::End(0)).unwrap(), 5); - assert_eq!(file.seek(std::io::SeekFrom::End(-1)).unwrap(), 4); - assert_eq!(file.seek(std::io::SeekFrom::End(-2)).unwrap(), 3); - assert_eq!(file.seek(std::io::SeekFrom::End(-3)).unwrap(), 2); - assert_eq!(file.seek(std::io::SeekFrom::End(-4)).unwrap(), 1); - assert_eq!(file.seek(std::io::SeekFrom::End(-5)).unwrap(), 0); -} diff --git a/std/wasi/testdata/std_fs_file_set_len.rs b/std/wasi/testdata/std_fs_file_set_len.rs deleted file mode 100644 index 27f1054c70..0000000000 --- a/std/wasi/testdata/std_fs_file_set_len.rs +++ /dev/null @@ -1,17 +0,0 @@ -// { "preopens": { "/scratch": "scratch" } } - -fn main() { - let file = std::fs::File::create("/scratch/file").unwrap(); - - assert!(file.set_len(0).is_ok()); - assert_eq!(file.metadata().unwrap().len(), 0); - - assert!(file.set_len(5).is_ok()); - assert_eq!(file.metadata().unwrap().len(), 5); - - assert!(file.set_len(25).is_ok()); - assert_eq!(file.metadata().unwrap().len(), 25); - - assert!(file.set_len(0).is_ok()); - assert_eq!(file.metadata().unwrap().len(), 0); -} diff --git a/std/wasi/testdata/std_fs_file_sync_all.rs b/std/wasi/testdata/std_fs_file_sync_all.rs deleted file mode 100644 index bb7bb34c7c..0000000000 --- a/std/wasi/testdata/std_fs_file_sync_all.rs +++ /dev/null @@ -1,15 +0,0 @@ -// { "preopens": { "/scratch": "scratch" } } - -fn main() { - let file = std::fs::File::create("/scratch/file").unwrap(); - - assert!(file.set_len(5).is_ok()); - assert!(file.sync_all().is_ok()); - let metadata = std::fs::metadata("/scratch/file").unwrap(); - assert_eq!(metadata.len(), 5); - - assert!(file.set_len(25).is_ok()); - assert!(file.sync_all().is_ok()); - let metadata = std::fs::metadata("/scratch/file").unwrap(); - assert_eq!(metadata.len(), 25); -} diff --git a/std/wasi/testdata/std_fs_file_sync_data.rs b/std/wasi/testdata/std_fs_file_sync_data.rs deleted file mode 100644 index f19f8e9b7f..0000000000 --- a/std/wasi/testdata/std_fs_file_sync_data.rs +++ /dev/null @@ -1,15 +0,0 @@ -// { "preopens": { "/scratch": "scratch" } } - -use std::io::Write; - -fn main() { - let mut file = std::fs::File::create("/scratch/file").unwrap(); - - assert!(file.write(b"Hello").is_ok()); - assert!(file.sync_data().is_ok()); - assert_eq!(std::fs::read("/scratch/file").unwrap(), b"Hello"); - - assert!(file.write(b", world!").is_ok()); - assert!(file.sync_data().is_ok()); - assert_eq!(std::fs::read("/scratch/file").unwrap(), b"Hello, world!"); -} diff --git a/std/wasi/testdata/std_fs_file_write.rs b/std/wasi/testdata/std_fs_file_write.rs deleted file mode 100644 index 6e646ba1d9..0000000000 --- a/std/wasi/testdata/std_fs_file_write.rs +++ /dev/null @@ -1,9 +0,0 @@ -// { "preopens": { "/scratch": "scratch" }, "files": { "scratch/file": "file" } } - -use std::io::Write; - -fn main() { - let mut file = std::fs::File::create("/scratch/file").unwrap(); - assert_eq!(file.write(b"fi").unwrap(), 2); - assert_eq!(file.write(b"le").unwrap(), 2); -} diff --git a/std/wasi/testdata/std_fs_hard_link.rs b/std/wasi/testdata/std_fs_hard_link.rs deleted file mode 100644 index cd068f3a8a..0000000000 --- a/std/wasi/testdata/std_fs_hard_link.rs +++ /dev/null @@ -1,11 +0,0 @@ -// { "preopens": { "/fixture": "fixture", "/scratch": "scratch" } } - -fn main() { - assert!( - std::fs::hard_link("/fixture/file", "/scratch/hardlink_to_file").is_ok() - ); - assert_eq!( - std::fs::read("/fixture/file").unwrap(), - std::fs::read("/scratch/hardlink_to_file").unwrap() - ); -} diff --git a/std/wasi/testdata/std_fs_metadata.rs b/std/wasi/testdata/std_fs_metadata.rs deleted file mode 100644 index d77ea2ae2c..0000000000 --- a/std/wasi/testdata/std_fs_metadata.rs +++ /dev/null @@ -1,26 +0,0 @@ -// { "preopens": { "/fixture": "fixture" } } - -fn main() { - let metadata = std::fs::metadata("/fixture/directory").unwrap(); - assert!(metadata.is_dir()); - - let metadata = std::fs::metadata("/fixture/symlink_to_directory").unwrap(); - assert!(metadata.is_dir()); - - let metadata = std::fs::metadata("/fixture/file").unwrap(); - assert!(metadata.is_file()); - assert_eq!(metadata.len(), 5); - - let metadata = std::fs::metadata("/fixture/symlink_to_file").unwrap(); - assert!(metadata.is_file()); - assert_eq!(metadata.len(), 5); - - let metadata = std::fs::metadata("/fixture/directory/file").unwrap(); - assert!(metadata.is_file()); - assert_eq!(metadata.len(), 15); - - let metadata = - std::fs::metadata("/fixture/directory/symlink_to_file").unwrap(); - assert!(metadata.is_file()); - assert_eq!(metadata.len(), 15); -} diff --git a/std/wasi/testdata/std_fs_read.rs b/std/wasi/testdata/std_fs_read.rs deleted file mode 100644 index aa19d3ba43..0000000000 --- a/std/wasi/testdata/std_fs_read.rs +++ /dev/null @@ -1,17 +0,0 @@ -// { "preopens": { "/fixture": "fixture" } } - -fn main() { - assert_eq!(std::fs::read("/fixture/file").unwrap(), b"file\n"); - assert_eq!( - std::fs::read("/fixture/symlink_to_file").unwrap(), - b"file\n" - ); - assert_eq!( - std::fs::read("/fixture/directory/file").unwrap(), - b"directory/file\n" - ); - assert_eq!( - std::fs::read("/fixture/directory/symlink_to_file").unwrap(), - b"directory/file\n" - ); -} diff --git a/std/wasi/testdata/std_fs_read_dir.rs b/std/wasi/testdata/std_fs_read_dir.rs deleted file mode 100644 index ad8b70c727..0000000000 --- a/std/wasi/testdata/std_fs_read_dir.rs +++ /dev/null @@ -1,9 +0,0 @@ -// { "preopens": { "/fixture": "fixture" } } - -fn main() { - let entries = std::fs::read_dir("/fixture").unwrap(); - assert_eq!(entries.count(), 4); - - let entries = std::fs::read_dir("/fixture/directory").unwrap(); - assert_eq!(entries.count(), 2); -} diff --git a/std/wasi/testdata/std_fs_rename.rs b/std/wasi/testdata/std_fs_rename.rs deleted file mode 100644 index 53688eecb0..0000000000 --- a/std/wasi/testdata/std_fs_rename.rs +++ /dev/null @@ -1,11 +0,0 @@ -// { "preopens": { "/scratch": "scratch" } } - -fn main() { - let old_path = "/scratch/old_file"; - let new_path = "/scratch/new_file"; - - assert!(std::fs::write(old_path, b"Hello, world!").is_ok()); - assert!(std::fs::rename(old_path, new_path).is_ok()); - assert!(std::fs::read(old_path).is_err()); - assert_eq!(std::fs::read(new_path).unwrap(), b"Hello, world!"); -} diff --git a/std/wasi/testdata/std_fs_symlink_metadata.rs b/std/wasi/testdata/std_fs_symlink_metadata.rs deleted file mode 100644 index 1b71fd5e0e..0000000000 --- a/std/wasi/testdata/std_fs_symlink_metadata.rs +++ /dev/null @@ -1,23 +0,0 @@ -// { "preopens": { "/fixture": "fixture" } } - -fn main() { - let metadata = std::fs::symlink_metadata("/fixture/directory").unwrap(); - assert!(metadata.file_type().is_dir()); - - let metadata = - std::fs::symlink_metadata("/fixture/symlink_to_directory").unwrap(); - assert!(metadata.file_type().is_symlink()); - - let metadata = std::fs::symlink_metadata("/fixture/file").unwrap(); - assert!(metadata.file_type().is_file()); - - let metadata = std::fs::symlink_metadata("/fixture/symlink_to_file").unwrap(); - assert!(metadata.file_type().is_symlink()); - - let metadata = std::fs::symlink_metadata("/fixture/directory/file").unwrap(); - assert!(metadata.file_type().is_file()); - - let metadata = - std::fs::symlink_metadata("/fixture/directory/symlink_to_file").unwrap(); - assert!(metadata.file_type().is_symlink()); -} diff --git a/std/wasi/testdata/std_fs_write.rs b/std/wasi/testdata/std_fs_write.rs deleted file mode 100644 index 91f8ca160e..0000000000 --- a/std/wasi/testdata/std_fs_write.rs +++ /dev/null @@ -1,5 +0,0 @@ -// { "preopens": { "/scratch": "scratch" }, "files": { "scratch/file": "file" } } - -fn main() { - assert!(std::fs::write("/scratch/file", b"file").is_ok()) -} diff --git a/std/wasi/testdata/std_io_stderr.rs b/std/wasi/testdata/std_io_stderr.rs deleted file mode 100644 index 8e1dee30ee..0000000000 --- a/std/wasi/testdata/std_io_stderr.rs +++ /dev/null @@ -1,7 +0,0 @@ -// { "stderr": "Hello, stderr!" } - -use std::io::Write; - -fn main() { - assert!(std::io::stderr().write_all(b"Hello, stderr!").is_ok()) -} diff --git a/std/wasi/testdata/std_io_stdin.rs b/std/wasi/testdata/std_io_stdin.rs deleted file mode 100644 index 170d575c55..0000000000 --- a/std/wasi/testdata/std_io_stdin.rs +++ /dev/null @@ -1,9 +0,0 @@ -// { "stdin": "Hello, stdin!" } - -use std::io::Read; - -fn main() { - let mut buffer = String::new(); - assert!(std::io::stdin().read_to_string(&mut buffer).is_ok()); - assert_eq!(buffer, "Hello, stdin!") -} diff --git a/std/wasi/testdata/std_io_stdout.rs b/std/wasi/testdata/std_io_stdout.rs deleted file mode 100644 index 3c9058a0dd..0000000000 --- a/std/wasi/testdata/std_io_stdout.rs +++ /dev/null @@ -1,7 +0,0 @@ -// { "stdout": "Hello, stdout!" } - -use std::io::Write; - -fn main() { - assert!(std::io::stdout().write_all(b"Hello, stdout!").is_ok()) -} diff --git a/std/wasi/testdata/std_process_exit.rs b/std/wasi/testdata/std_process_exit.rs deleted file mode 100644 index 0a0287c545..0000000000 --- a/std/wasi/testdata/std_process_exit.rs +++ /dev/null @@ -1,5 +0,0 @@ -// { "exitCode": "120" } - -fn main() { - std::process::exit(120); -}