From 41cde566bb81bdd5f9ffdefadc7c8256c65624dc Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 30 Jan 2014 14:28:20 -0800 Subject: extra: Fix tests with io_error usage --- src/libextra/workcache.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/libextra/workcache.rs') diff --git a/src/libextra/workcache.rs b/src/libextra/workcache.rs index 3d91ccda189..4d8e7e50dcf 100644 --- a/src/libextra/workcache.rs +++ b/src/libextra/workcache.rs @@ -473,13 +473,13 @@ fn test() { fn make_path(filename: ~str) -> Path { let pth = os::self_exe_path().expect("workcache::test failed").with_filename(filename); if pth.exists() { - fs::unlink(&pth); + fs::unlink(&pth).unwrap(); } return pth; } let pth = make_path(~"foo.c"); - File::create(&pth).write(bytes!("int main() { return 0; }")); + File::create(&pth).write(bytes!("int main() { return 0; }")).unwrap(); let db_path = make_path(~"db.json"); @@ -491,7 +491,8 @@ fn test() { let subcx = cx.clone(); let pth = pth.clone(); - let file_content = from_utf8_owned(File::open(&pth).read_to_end()).unwrap(); + let contents = File::open(&pth).read_to_end().unwrap(); + let file_content = from_utf8_owned(contents).unwrap(); // FIXME (#9639): This needs to handle non-utf8 paths prep.declare_input("file", pth.as_str().unwrap(), file_content); @@ -500,7 +501,7 @@ fn test() { // FIXME (#9639): This needs to handle non-utf8 paths run::process_status("gcc", [pth.as_str().unwrap().to_owned(), ~"-o", - out.as_str().unwrap().to_owned()]); + out.as_str().unwrap().to_owned()]).unwrap(); let _proof_of_concept = subcx.prep("subfn"); // Could run sub-rules inside here. -- cgit 1.4.1-3-g733a5