rust/tests/run-pass/file_read.rs

13 lines
346 B
Rust
Raw Normal View History

2019-09-24 17:28:00 -05:00
// ignore-windows: File handling is not implemented yet
// compile-flags: -Zmiri-disable-isolation
use std::fs::File;
use std::io::Read;
fn main() {
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);
}