Browse Source
* add new wasi-test printing unicode on stdout there's not yet a way to show this test is actually doing what we intend, I'm using CI to see how this runs on all platforms Reported in #6824 prtest:full * cap-std-sync: use std::io::Std{in,out,err}'s {read,write}_vectored directly instead of using AsFilelike to view these as a File. This means we also have to use std's mutexes to access these descriptors, which also seems like a good idea. We believe will fix unicode output on windows issues: https://github.com/bytecodealliance/wasmtime/issues/6824pull/7032/head
Pat Hickey
1 year ago
committed by
GitHub
7 changed files with 37 additions and 4 deletions
@ -0,0 +1,15 @@ |
|||
use wasi_tests::STDOUT_FD; |
|||
fn main() { |
|||
let text = "مرحبا بكم\n"; |
|||
|
|||
let ciovecs = [wasi::Ciovec { |
|||
buf: text.as_bytes().as_ptr(), |
|||
buf_len: text.as_bytes().len(), |
|||
}]; |
|||
let written = unsafe { wasi::fd_write(STDOUT_FD, &ciovecs) }.expect("write succeeds"); |
|||
assert_eq!( |
|||
written, |
|||
text.as_bytes().len(), |
|||
"full contents should be written" |
|||
); |
|||
} |
Loading…
Reference in new issue