mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 05:57:03 +03:00
Auto merge of #962 - christianpoveda:file-shim, r=oli-obk
Add shims for file handling This adds the bare minimum to be able to do `File::open` and `File::read`. I also need some feedback about how to handle certain things
This commit is contained in:
@@ -0,0 +1 @@
|
||||
Hello, World!
|
||||
@@ -0,0 +1,13 @@
|
||||
// ignore-windows: File handling is not implemented yet
|
||||
// compile-flags: -Zmiri-disable-isolation
|
||||
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
|
||||
fn main() {
|
||||
// FIXME: create the file and delete it when `rm` is implemented.
|
||||
let mut file = File::open("./tests/hello.txt").unwrap();
|
||||
let mut contents = String::new();
|
||||
file.read_to_string(&mut contents).unwrap();
|
||||
assert_eq!("Hello, World!\n", contents);
|
||||
}
|
||||
Reference in New Issue
Block a user