diff --git a/lib/wasi-tests/wasitests/fd_append.rs b/lib/wasi-tests/wasitests/fd_append.rs index f1e55c5ed9a..2e311652e4d 100644 --- a/lib/wasi-tests/wasitests/fd_append.rs +++ b/lib/wasi-tests/wasitests/fd_append.rs @@ -35,14 +35,17 @@ fn main() { file_handle.write(STR2.as_bytes()).unwrap(); } - let mut file_handle = OpenOptions::new() - .read(true) - .open(&file) - .expect("Couldn't reopen file to read"); + { + let mut file_handle = OpenOptions::new() + .read(true) + .open(&file) + .expect("Couldn't reopen file to read"); - let mut test = String::new(); - file_handle.read_to_string(&mut test); + let mut test = String::new(); + file_handle.read_to_string(&mut test); - assert_eq!(&test, &format!("{}{}", STR1, STR2)); - println!("{:?}", &test); + assert_eq!(&test, &format!("{}{}", STR1, STR2)); + println!("{:?}", &test); + } + std::fs::remove_file(&file).unwrap(); } diff --git a/lib/wasi-tests/wasitests/fd_append.wasm b/lib/wasi-tests/wasitests/fd_append.wasm index b1c73d14fab..af40f8af9c1 100755 Binary files a/lib/wasi-tests/wasitests/fd_append.wasm and b/lib/wasi-tests/wasitests/fd_append.wasm differ