Skip to content

Commit

Permalink
Explicitly delete temp file in fd_append test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark McCaskey committed Nov 9, 2019
1 parent 3341528 commit adc9f3d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions lib/wasi-tests/wasitests/fd_append.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Binary file modified lib/wasi-tests/wasitests/fd_append.wasm
Binary file not shown.

0 comments on commit adc9f3d

Please sign in to comment.