Files
wasmtime/crates/test-programs/wasi-tests/src/bin/stdio.rs
Jakub Konka 51f3ac0c45 Update WASI tests to use wasi crate v0.9.0 (#743)
This commit updates _all_ WASI test programs to use the latest
version of the `wasi` crate (`v0.9.0`). While at it, it also
unifies asserting error conditions across all test programs.
2019-12-24 13:04:14 -08:00

14 lines
337 B
Rust

use wasi_tests::{STDERR_FD, STDIN_FD, STDOUT_FD};
unsafe fn test_stdio() {
for fd in &[STDIN_FD, STDOUT_FD, STDERR_FD] {
wasi::fd_fdstat_get(*fd).expect("fd_fdstat_get on stdio");
wasi::fd_renumber(*fd, *fd + 100).expect("renumbering stdio");
}
}
fn main() {
// Run the tests.
unsafe { test_stdio() }
}